-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
gh-99845: Change _PyDict_KeysSize() return type to size_t #99848
Conversation
vstinner
commented
Nov 28, 2022
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Change _PyDict_KeysSize() and shared_keys_usable_size() return type from signed (Py_ssize_t) to unsigned (size_t) type.
- new_values() argument type is now unsigned (size_t).
- init_inline_values() now uses size_t rather than int for the 'i' iterator variable.
- type.sizeof() implementation now uses unsigned (size_t) type.
- Issue: PEP 670: Convert _PyObject_SIZE() and _PyObject_VAR_SIZE() macros to functions #99845
* Change _PyDict_KeysSize() and shared_keys_usable_size() return type from signed (Py_ssize_t) to unsigned (size_t) type. * new_values() argument type is now unsigned (size_t). * init_inline_values() now uses size_t rather than int for the 'i' iterator variable. * type.__sizeof__() implementation now uses unsigned (size_t) type.
cc @methane |
I would prefer to change |
Another more radical change is to move the private function to internal C API, and frozendict should call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch looks good to me.
Is Py_ssize_t recommended for container size and size_t recommended for memory size for now?
I was confused by |