Open piotryordanov opened 3 hours ago
#[pyo3(text_signature = "(index=1)"]
should go on your #[new]
function since PyO3 0.19.
Ah, thanks for flagging - docs need fixing!
@davidhewitt I tried the change you suggested, but for some reason, it's not propagatd to python.
#[pymethods]
impl Signal {
/// This is a signal that does xyz
#[new]
#[pyo3(text_signature = "(index)")]
fn new(index: i32) -> Self {
Signal { index }
}
And in python, the signature for __new__
shows as:
($type, *args, **kwargs)
Bug Description
I expect to be able to add the
text_signature
to thepyclass
, but it's failing. Running pyo3 version 0.22.3.Steps to Reproduce
Backtrace