Open
Conversation
Author
|
Hi @mahmoud, have you had a chance to check this one out? It think it would make a nice addition to your package. |
Owner
|
Oh hey! This is fun. @kurtbrose and I played around with a much more minimal approach to this back in the day: https://www.pythondoeswhat.com/2010/12/attributedict-dictionary-whose-keys-are.html These days I recommend using glom instead of changing the type. |
Author
|
Hey @mahmoud and @kurtbrose, thanks kindly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to
boltons/dictutils.py, focusing on code style improvements, bug fixes, and the addition of a new utility class. The most notable change is the introduction of theDotDictclass, which provides dot notation access for dictionary keys. Other changes include consistent string formatting, improved readability, and minor adjustments to existing methods.New Feature:
DotDictclass: Added a new utility class that allows dot notation access to dictionary keys, with automatic conversion of nested dictionaries intoDotDictinstances. Includes methods for updating, deleting, and converting back to a regular dictionary. [1]Code Style Improvements:
__init__,__eq__,poplast, and__repr__. [1] [2] [3] [4] [5] [6] [7]sortedvaluesand__init__methods. [1] [2]Refactoring:
_insert,update, and__eq__methods, to enhance clarity. [1] [2] [3]__slots__adjustments: Updated__slots__definitions in classes likeOneToOneandFrozenDictto use double quotes for consistency. [1] [2]Minor Adjustments: