gh-145497: Fix _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES#151152
Conversation
The _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES macro is no longer a hardcoded number to reduce the maintenance burden. * Add _Py_NUM_STATIC_EXCEPTIONS: size of the static_exceptions array. * Add _Py_FOREACH_STATIC_EXTRA_TYPE() to count the number of extra types. Co-authored-by: Donghee Na <donghee.na@python.org>
| update one of these numbers. | ||
| */ | ||
| #define _Py_NUM_MANAGED_PREINITIALIZED_TYPES 120 | ||
| #define _Py_NUM_STATIC_EXCEPTIONS 69 |
There was a problem hiding this comment.
Now you mange the number of _Py_NUM_STATIC_EXCEPTIONS manually, I beleive that this is not what we wanted
| If you add a new static type to the standard library, you may have to | ||
| update one of these numbers. | ||
| */ | ||
| #define _Py_NUM_MANAGED_PREINITIALIZED_TYPES 120 |
There was a problem hiding this comment.
Still _Py_NUM_MANAGED_PREINITIALIZED_TYPES is manged by hand.
|
My original intention of this issue is that people don't need to care about the actual number of types they need to know. |
If you had an item to |
Yeah I agree that point, the only problem might be coverage of the solution that we want to cover :) |
The _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES macro is no longer a hardcoded number to reduce the maintenance burden.