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

fix https://github.com/rnag/dotwiz/issues/24 #38

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

timotheecour
Copy link

@timotheecour timotheecour commented Feb 9, 2024

fix #24
@rnag @orlof
also relevant articles:
https://stackoverflow.com/questions/51540806/how-to-auto-update-keys-from-a-class-inherited-from-dict/51541098#51541098
https://towardsdatascience.com/python-inheritance-should-you-inherit-from-dict-or-userdict-9b4450830cbb
https://treyhunner.com/2019/04/why-you-shouldnt-inherit-from-list-and-dict-in-python/
http://www.kr41.net/2016/03-23-dont_inherit_python_builtin_dict_type.html
https://stackoverflow.com/a/39375731/1426932

regarding inheriting from dict vs UserDict vs collections.abc.MutableMapping, which involves tradeoffs in performance vs complexity; in particular https://treyhunner.com/2019/04/why-you-shouldnt-inherit-from-list-and-dict-in-python/ sheds some light on why the bug was occuring. Future work should investigate deriving from collections.abc.MutableMapping which might have less gotchas compared to inheriting from dict, but maybe more performant than inheriting from UserDict

@timotheecour
Copy link
Author

ping @rnag

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.

deleting attribute or item does not remove attribute
1 participant