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:
Gertjan van Zwieten 2021-11-15 09:01:05 +01:00
parent 3044bd9615
commit 0e40277112
1 changed files with 1 additions and 1 deletions

View File

@ -98,7 +98,7 @@ impl PyCounter {
fn __new__(wraps: Py<PyAny>) -> Self {
PyCounter { count: 0, wraps }
}
#[args(args="*", kwargs="**")]
fn __call__(
&mut self,
py: Python,