-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
make the type-parameter of ctypes.py_object
optional
#13760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
Which begs the question, should |
Maybe? But even if that were to be changed in cpython, then that'd only fix it for 3.14+ or something. So I suppose that this would still be relevant |
It seems that there's very few instances of generic |
Well, I admit that this is mostly self-interest, haha. Oh and it's optype btw ;) |
Not at the moment, no. But once mypy fully supports |
d5c4051
to
f7e2270
Compare
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Type-checkers currently require a generic type argument for
ctypes.py_object
. But at runtime this can raise aTypeError
if not quoted.We can avoid this contradictory paradox that's sending conflicting mixed signals by setting the type-parameter default of
ctypes.py_object
toAny
.