pub fn call_method0(&self, name: &str) -> PyResult<&PyAny> {
        cfg_if::cfg_if! {
            if #[cfg(all(Py_3_9, not(any(Py_LIMITED_API, PyPy))))] {
                // Optimized path on python 3.9+
                unsafe {
                    let name = name.into_py(self.py());
            self.py().from_owned_ptr_or_err(ffi::PyObject_CallMethodNoArgs(self.as_ptr(), name.as_ptr()))
                }
            } else {
                self.call_method(name, (), None)
            }
        }
    }
/// Calls a method on the object without arguments.
///
/// This is equivalent to the Python expression `self.name()`.
///
/// # Examples
///
/// ```rust
/// use pyo3::prelude::*;
/// use pyo3::types::PyFloat;
/// use std::f64::consts::PI;
///
/// # fn main() -> PyResult<()> {
/// Python::with_gil(|py| -> PyResult<()> {
///     let pi = PyFloat::new(py, PI);
///     let ratio = pi.call_method0("as_integer_ratio")?;
///     let (a, b) = ratio.extract::<(u64, u64)>()?;
///     assert_eq!(a, 884_279_719_003_555);
///     assert_eq!(b, 281_474_976_710_656);
///     Ok(())
/// })?;
/// # Ok(())}
/// ```
///
/// This is equivalent to the following Python code:
///
/// ```python
/// import math
///
/// a, b = math.pi.as_integer_ratio()
/// ```
Calls a method on the object without arguments.
This is equivalent to the Python expression `self.name()`.
Calls a method on the object without arguments . This is equivalent to the Python expression ` self . name () ` .
pub fn call_method0(&self, name: &str) -> PyResult<&PyAny> {
        cfg_if::cfg_if! {
            if #[cfg(all(Py_3_9, not(any(Py_LIMITED_API, PyPy))))] {
                // Optimized path on python 3.9+
                unsafe {
                    let name = name.into_py(self.py());
            self.py().from_owned_ptr_or_err(ffi::PyObject_CallMethodNoArgs(self.as_ptr(), name.as_ptr()))
                }
            } else {
                self.call_method(name, (), None)
            }
        }
    }
pub fn call_method0 ( & self , name : & str ) -> PyResult < & PyAny > { cfg_if :: cfg_if ! { if [ cfg ( all ( Py_3_9 not ( any ( Py_LIMITED_API PyPy ) ) ) ) ] { // Optimized path on python 3.9+ unsafe { let name name into_py ( self py ( ) ) self py ( ) from_owned_ptr_or_err ( ffi PyObject_CallMethodNoArgs ( self as_ptr ( ) name as_ptr ( ) ) ) } } else { self call_method ( name ( ) None ) } } }
Calls a method on the object without arguments.
Calls a method on the object without arguments .
&self
name
&str
&self
name
&str
examples
```rust
use pyo3::prelude::*;
use pyo3::types::PyFloat;
use std::f64::consts::PI.
` ` ` rust use pyo3 :: prelude :: * ; use pyo3 :: types :: PyFloat ; use std :: f64 :: consts :: PI .
fn main() -> pyresult<()> {
None
ok(())}


This is equivalent to the following Python code.

```python
import math

a, b = math.pi.as_integer_ratio()
```
This is equivalent to the following Python code . ` ` ` python import math a b = math . pi . as_integer_ratio () ` ` `