| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Which begs the question, should ctypes.py_object define __class_getitem__ at runtime, to mirror the stubs? |
Sorry, something went wrong.
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 |
Sorry, something went wrong.
|
It seems that there's very few instances of generic py_object being used in the wild, most of which are from numpy/optypes. Is it being generic actually useful? I wonder if it would make sense to specialize it to Any or object |
Sorry, something went wrong.
Well, I admit that this is mostly self-interest, haha. Oh and it's optype btw ;) |
Sorry, something went wrong.
Not at the moment, no. But once mypy fully supports __new__, then I can make numpy.object_ generic. And then it would help to also have a generic ctypes.py_object. |
Sorry, something went wrong.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Type-checkers currently require a generic type argument for ctypes.py_object. But at runtime this can raise a TypeError 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 to Any.