-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
[C API] Use new PyDict_GetItemRef() C API #108308
Labels
Comments
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 22, 2023
Replace PyDict_GetItem() calls with PyDict_GetItemRef() to handle errors. pycore_init_builtins() now checks for _PyType_Lookup() failure.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 22, 2023
Replace PyDict_GetItem() calls with PyDict_GetItemRef() to handle errors. pycore_init_builtins() now checks for _PyType_Lookup() failure.
vstinner
added a commit
that referenced
this issue
Aug 23, 2023
Replace PyDict_GetItem() calls with PyDict_GetItemRef() or PyDict_GetItemWithError() to handle errors. * Replace PyLong_AS_LONG() with _PyLong_AsInt() and check for errors. * Check for PyDict_Contains() error. * pycore_init_builtins() checks for _PyType_Lookup() failure.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 23, 2023
Replace PyDict_GetItemWithError() calls with PyDict_GetItemRef() in config_dict_get() to get a strong reference to the item.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 23, 2023
Replace _PyDict_GetItemStringWithError() with PyDict_GetItemRef() in config_dict_get() to get a strong reference to the item.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 23, 2023
Replace _PyDict_GetItemStringWithError() calls with PyDict_GetItemStringRef().
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 23, 2023
Replace _PyDict_GetItemStringWithError() calls with PyDict_GetItemStringRef().
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 23, 2023
Replace _PyDict_GetItemStringWithError() calls with PyDict_GetItemStringRef() which returns a strong reference to the item.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 23, 2023
Replace _PyDict_GetItemStringWithError() calls with PyDict_GetItemStringRef() which returns a strong reference to the item.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 23, 2023
Replace _PyDict_GetItemStringWithError() calls with PyDict_GetItemStringRef() which returns a strong reference to the item. Co-Authored-by: Serhiy Storchaka <[email protected]>
vstinner
added a commit
that referenced
this issue
Aug 23, 2023
Replace _PyDict_GetItemStringWithError() calls with PyDict_GetItemStringRef() which returns a strong reference to the item. Co-authored-by: Serhiy Storchaka <[email protected]>
vstinner
added a commit
that referenced
this issue
Aug 23, 2023
Replace _PyDict_GetItemStringWithError() with PyDict_GetItemRef() in config_dict_get() to get a strong reference to the item.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 23, 2023
Replace PyDict_GetItemWithError() with PyDict_GetItemRef() which returns a strong reference. Cleanup also the function: move variable definition to their first assignation, rename variable names to use name longer than 1 character.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 23, 2023
Replace PyDict_GetItemWithError() with PyDict_GetItemRef() which returns a strong reference. Cleanup also the function: move variable definition to their first assignation, rename variable names to use name longer than 1 character.
vstinner
added a commit
that referenced
this issue
Aug 23, 2023
Replace PyDict_GetItemWithError() with PyDict_GetItemRef() which returns a strong reference. Cleanup also the function: move variable definition to their first assignation, rename variable names to use name longer than 1 character.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Aug 24, 2023
Remove the internal _PyDict_GetItemStringWithError() function. It can now be replaced with the new public PyDict_ContainsString() and PyDict_GetItemStringRef() functions. getargs.c now uses a strong reference for current_arg. find_keyword() returns a strong reference.
vstinner
added a commit
that referenced
this issue
Aug 24, 2023
Remove the internal _PyDict_GetItemStringWithError() function. It can now be replaced with the new public PyDict_ContainsString() and PyDict_GetItemStringRef() functions. getargs.c now now uses a strong reference for current_arg. find_keyword() returns a strong reference.
PyDict_GetItem() and PyDict_GetItemString() are no longer used in Python code base. I added PyDict_ContainsString() and removed the _PyDict_GetItemStringWithError() function. I consider that the work is now done here, I close the issue. Thanks to everyone who helped with reviews :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Checklist
and am confident this bug has not been reported before
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
No response
A clear and concise description of the bug:
Calls to PyDict_GetItem() should be replaced with PyDict_GetItemRef().
PyDict_GetItemWithError() may also be replaced with PyDict_GetItemRef().
Linked PRs
The text was updated successfully, but these errors were encountered: