Skip to content
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

PyDict should expose a wrapper over PyDict_GetItemWithError #565

Closed
nagisa opened this issue Aug 5, 2019 · 1 comment · Fixed by #2536
Closed

PyDict should expose a wrapper over PyDict_GetItemWithError #565

nagisa opened this issue Aug 5, 2019 · 1 comment · Fixed by #2536

Comments

@nagisa
Copy link
Contributor

nagisa commented Aug 5, 2019

Currently PyDict::get_item wraps PyDict_GetItem and returns an Option::None when the key is missing or an exception occurs. It makes code incapable to differentiate between the two scenarios and code like this likely incorrect:

dict.get_item("key").ok_or_else(|| KeyError::py_err("key"))?;
@davidhewitt davidhewitt added this to the 0.15 milestone Jul 4, 2021
@davidhewitt
Copy link
Member

Marking for part of possible collections improvements in 0.15

@davidhewitt davidhewitt modified the milestones: 0.15, 0.16 Nov 7, 2021
@davidhewitt davidhewitt modified the milestones: 0.16, 0.17 Feb 26, 2022
@davidhewitt davidhewitt modified the milestones: 0.17, 0.18 Jul 3, 2022
@davidhewitt davidhewitt modified the milestones: 0.18, 0.17 Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants