make the type-parameter of ctypes.py_object optional#13760
make the type-parameter of ctypes.py_object optional#13760srittau merged 1 commit intopython:mainfrom
ctypes.py_object optional#13760Conversation
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 aTypeErrorif not quoted.We can avoid this contradictory paradox that's sending conflicting mixed signals by setting the type-parameter default of
ctypes.py_objecttoAny.