Magic methods in #[pymethods]
don't check they have the correct number of arguments
#2010
Labels
Milestone
#[pymethods]
don't check they have the correct number of arguments
#2010
From #1964:
Yeah I kinda knew about this and was thinking it was a minor bug. It probably should be checked and a nice error message emitted. Users missing arguments off is probably an incorrect implementation imo so we should at least force them to be explicit about unused arguments.
The code responsible is:
pyo3/pyo3-macros-backend/src/pymethod.rs
Line 955 in 0f92f28
method_args are the arguments the user wrote for the method; at the moment the code just iterates it without checking its length. Slightly complicated by the Python arguments but not too bad.
Anyone who's interested in helping out with this, it should be a reasonably self-contained piece.
The text was updated successfully, but these errors were encountered: