| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| continue; | ||
| } | ||
| if (PyObject_GetOptionalAttrString(base, PyId___mro_entries__.string, &meth) < 0) { | ||
| if (PyObject_GetOptionalAttrString(base, "__mro_entries__", &meth) < 0) { |
There was a problem hiding this comment.
We can't use mypyc_interned_str.__mro_entries__ here since it isn't initialized yet when the header file is loaded. Similarly for __init_subclass__ below.
I believe the best solution might be to just move these functions to pythonsupport.c but that can be done at a later point.
Sorry, something went wrong.
| } | ||
| #endif | ||
|
|
||
| #if PY_VERSION_HEX >= 0x030A0000 // 3.10 |
There was a problem hiding this comment.
Mypy recently dropped support for Python 3.9, so the version guard is no longer necessary.
Sorry, something went wrong.
There was a problem hiding this comment.
Great, thanks!
Sorry, something went wrong.
There was a problem hiding this comment.
Nice!
Sorry, something went wrong.
Followup to #20460 (comment) It's not possible to use `mypyc_interned_str.<name>` in header files. Move some functions from `pythonsupport.h` to `pythonsupport.c`.
| Back | FazBrowse Home | New Git URL |
Uses of _PY_IDENTIFIER will trigger a deprecation warning for Python 3.15. Replace these with statically allocated PyObject unicode objects which are being prevented from garbage collection via PyUnicode_InternFromString.
The implementation is adopted from a similar one in numpy.
https://github.com/numpy/numpy/blob/v2.4.0/numpy/_core/src/multiarray/npy_static_data.h
https://github.com/numpy/numpy/blob/v2.4.0/numpy/_core/src/multiarray/npy_static_data.c
https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_InternFromString
Replaces #19870