Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: enhance missing methods to handle missing keys more explicitly i…#59

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
t4m4k0ty4 wants to merge1 commit intofluentpython:master
base:master
Choose a base branch
Loading
fromt4m4k0ty4:master

Conversation

t4m4k0ty4
Copy link

Description

This PR improves the implementation ofmissing methods across several mapping subclasses to ensure safer and more predictable behavior when attempting to access keys in a case-insensitive manner.

Problem

In the original version, calls to self[_upper(key)] were made without checking if the transformed key actually exists. This could result in unhandled KeyErrors or unintended recursion, especially in dictionary-like structures wheremissing is automatically called upon a missing key.

Impact of my solution

This change enhances code clarity and error safety, making the behavior of custom mappings more robust and closer to Python’s expectations formissing.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@t4m4k0ty4

[8]ページ先頭

©2009-2025 Movatter.jp