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

Make Dict a mutable mapping #2676

Open
4 of 15 tasks
sphuber opened this issue Mar 30, 2019 · 3 comments
Open
4 of 15 tasks

Make Dict a mutable mapping #2676

sphuber opened this issue Mar 30, 2019 · 3 comments

Comments

@sphuber
Copy link
Contributor

sphuber commented Mar 30, 2019

Potential methods, we might want to implement:

  • clear
  • get
  • items
  • keys
  • pop
  • popitem
  • setdefault
  • update
  • values
  • __getitem__
  • __setitem__
  • __delitem__
  • __getattr__
  • __setattr__
  • __delattr__
@zhubonan
Copy link
Contributor

zhubonan commented Apr 1, 2019

This would be convenient. At the moment I have to write extra lines to create a dict from Dict, update and save it back.

@sphuber
Copy link
Contributor Author

sphuber commented Apr 1, 2019

Note that the mutable methods will not work for a stored node, however. Or we might decide that when that is the case, a normal dict is made out of the stored node, the method is applied on that object and then returned. But this kind of magic may be too counter-intuitive and too dangerous.

@mbercx
Copy link
Member

mbercx commented Apr 15, 2023

@sphuber found this old issue when looking for issues related to #5970. Something to consider if/when we try to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants