add missing annotation to PyCounter.__call__
This patch annotates the `__call__` method of `PyCounter` in example: callable objects with `#[args(args="*", kwargs="**")]`. Without it (at least in PyO3 0.15.0) the example fails with `TypeError: counter.__call__() missing 1 required positional argument: 'args'`.
This commit is contained in:
parent
3044bd9615
commit
0e40277112
|
@ -98,7 +98,7 @@ impl PyCounter {
|
||||||
fn __new__(wraps: Py<PyAny>) -> Self {
|
fn __new__(wraps: Py<PyAny>) -> Self {
|
||||||
PyCounter { count: 0, wraps }
|
PyCounter { count: 0, wraps }
|
||||||
}
|
}
|
||||||
|
#[args(args="*", kwargs="**")]
|
||||||
fn __call__(
|
fn __call__(
|
||||||
&mut self,
|
&mut self,
|
||||||
py: Python,
|
py: Python,
|
||||||
|
|
Loading…
Reference in a new issue