pub fn call0(&self) -> PyResult<&PyAny> {
        cfg_if::cfg_if! {
            if #[cfg(all(Py_3_9, not(PyPy)))] {
                // Optimized path on python 3.9+
                unsafe {
                    self.py().from_owned_ptr_or_err(ffi::PyObject_CallNoArgs(self.as_ptr()))
                }
            } else {
                self.call((), None)
            }
        }
    }
/// Calls the object without arguments.
///
/// This is equivalent to the Python expression `self()`.
///
/// # Examples
///
/// ```no_run
/// use pyo3::prelude::*;
///
/// # fn main() -> PyResult<()> {
/// Python::with_gil(|py| -> PyResult<()> {
///     let module = PyModule::import(py, "builtins")?;
///     let help = module.getattr("help")?;
///     help.call0()?;
///     Ok(())
/// })?;
/// # Ok(())}
/// ```
///
/// This is equivalent to the Python expression `help()`.
Calls the object without arguments.
This is equivalent to the Python expression `self()`.
Calls the object without arguments . This is equivalent to the Python expression ` self () ` .
pub fn call0(&self) -> PyResult<&PyAny> {
        cfg_if::cfg_if! {
            if #[cfg(all(Py_3_9, not(PyPy)))] {
                // Optimized path on python 3.9+
                unsafe {
                    self.py().from_owned_ptr_or_err(ffi::PyObject_CallNoArgs(self.as_ptr()))
                }
            } else {
                self.call((), None)
            }
        }
    }
pub fn call0 ( & self ) -> PyResult < & PyAny > { cfg_if :: cfg_if ! { if [ cfg ( all ( Py_3_9 not ( PyPy ) ) ) ] { // Optimized path on python 3.9+ unsafe { self py ( ) from_owned_ptr_or_err ( ffi PyObject_CallNoArgs ( self as_ptr ( ) ) ) } } else { self call ( ( ) None ) } } }
Calls the object without arguments.
Calls the object without arguments .
&self
&self
examples
None
fn main() -> pyresult<()> {
:with_gil(|py| -> PyResult<()> {
let module = PyModule::import(py, "builtins")?;
let help = module.getattr("help")?;
help.call0()?;
Ok(())
})?.
: with_gil ( |py| - > PyResult< () > { let module = PyModule :: import ( py " builtins " ) ? ; let help = module . getattr ( " help " ) ? ; help . call0 () ? ; Ok (( )) } ) ? .
ok(())}


This is equivalent to the Python expression `help()`.
This is equivalent to the Python expression ` help () ` .