You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to add my doc-string and an explicit signature for __new__ and __init__ to Foo:
/// Foo(arg1, arg2)/// --////// A Foo#[pyclass(name=Foo)]pubstructPyFoo{inner:Rc<RefCell<Foo>>,}#[pymethods]implPyFoo{/// __new__(arg1, arg2)/// --////// Construct a new Foo#[new]fn__new__(obj:&PyRawObject,arg1:Vec<&str>,arg2:Vec<&str>) -> PyResult<()>{
...}
So far, I'm getting the call signature of Foo via inspect.signature(Foo) or with IPython Foo? but not through help(Foo). Both __new__ and __init__ remain with their generic doc-strings and signatures defined in typeobject.c.
As far as I understand, CPython expects functions for tp_new and tp_init which is why the ml_doc fields of their PyMethodDef get discarded in pyo3::type_object::py_class_method_defs. Is there some other way to modify the doc-strings of these built-ins?
The text was updated successfully, but these errors were encountered:
I am trying to add my doc-string and an explicit signature for
__new__
and__init__
toFoo
:So far, I'm getting the call signature of
Foo
viainspect.signature(Foo)
or with IPythonFoo?
but not throughhelp(Foo)
. Both__new__
and__init__
remain with their generic doc-strings and signatures defined in typeobject.c.As far as I understand, CPython expects functions for
tp_new
andtp_init
which is why theml_doc
fields of theirPyMethodDef
get discarded inpyo3::type_object::py_class_method_defs
. Is there some other way to modify the doc-strings of these built-ins?The text was updated successfully, but these errors were encountered: