Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use PyDict_Pop() #116437

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

Closed
serhiy-storchaka opened this issue Mar 6, 2024 · 0 comments
Closed

Use PyDict_Pop() #116437

serhiy-storchaka opened this issue Mar 6, 2024 · 0 comments
Labels
3.13 bugs and security fixes

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Mar 6, 2024

PyDict_Pop() can be used in two cases:

  • If the PyDict_Get* call is followed by the PyDict_Del* call.
  • If the PyDict_Del* call is followed by the code that handles KeyError.

In both cases the use of PyDict_Pop() can make the code clearer.

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes
Projects
None yet
Development

No branches or pull requests

1 participant