fix: 🐛 do not remove self parameter annotation when types do not match #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Always removing the first parameter's type annotation when its name is
"self"
can mask underlying issues in the C++ binding, which is more obviously revealed when you only remove the parameter's annotation when it matches the class name it is bound to or it istyping.Any
.I noticed this bug since there was an unused import in
demo/_bindings/aliases/foreign_method_arg.pyi
, which seemed strange until I noticed that the sole parameter was actually in fact typed as aFoo
in the C++ code (the C++ method implementation is missing aself
parameter). I think making this change will help to make these bugs in the underlying C++ code more obvious: