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

Expose PyDict_GetItemWithError on PyDict object #2536

Merged
merged 5 commits into from Aug 6, 2022
Merged

Conversation

dswij
Copy link
Contributor

@dswij dswij commented Aug 4, 2022

Closes #565

Please consider adding the following to your pull request:

  • an entry in CHANGELOG.md
  • docs to all new functions and / or detail in the guide
  • tests for all new or changed functions

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - implementation looks fine to me! Please add an ## Added entry in the CHANGELOG.

assert!(dict.get_item_with_error(8i32).unwrap().is_none());

let dict_clone = dict.clone();
if let Err(err) = dict.get_item_with_error(dict_clone) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: use .unwrap_err() here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 3f1df62

Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

I'm trying to fix the Windows coverage issue in taiki-e/cargo-llvm-cov#203

@messense messense merged commit 480fe7e into PyO3:main Aug 6, 2022
@dswij dswij deleted the 565 branch August 7, 2022 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PyDict should expose a wrapper over PyDict_GetItemWithError
3 participants