Skip to content

add StaticDotMap#112

Open
FelixSchwarz wants to merge 1 commit into
drgrib:masterfrom
FelixSchwarz:static_dotmap
Open

add StaticDotMap#112
FelixSchwarz wants to merge 1 commit into
drgrib:masterfrom
FelixSchwarz:static_dotmap

Conversation

@FelixSchwarz

Copy link
Copy Markdown
Collaborator

This is a small utility class I wrote a long time ago. I disliked setting a "privat" attribute every time.

The class behaves exactly like DotMap(_dynamic=False) (which is no wonder if you look at the actual implementation). However this means:

  • adding new attributes via __setitem__ still works
  • hence the class must be typed as MutableMapping

I'm open to changing it but that might be a bit of work.

Disclaimer: Tests written by Claude with a bit of manual tweaking afterwards.

@FelixSchwarz

Copy link
Copy Markdown
Collaborator Author

@drgrib Any comments on that addition? If you don't have an opinion, I would like to merge this.

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.

1 participant