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

HashTableNT: support adding and removing elements from the namedtuple? #31

Open
ThomasWaldmann opened this issue Nov 12, 2024 · 1 comment
Milestone

Comments

@ThomasWaldmann
Copy link
Member

Think about whether we want such functionality in HashTableNT or if such stuff rather belongs elsewhere (like in the HashTableNT users code):

  • dropping an element and loading an old ht that still has it is relatively straightforward
  • adding an element and loading an old ht that does not yet have it is more difficult: would need a default value for the new element.
@ThomasWaldmann ThomasWaldmann added this to the 0.1.0 milestone Nov 12, 2024
@ThomasWaldmann
Copy link
Member Author

https://docs.python.org/3/library/collections.html#collections.namedtuple

  • we could require giving a default for all (or new) elements in the namedtuple defaults list
  • _field_defaults is the namedtuple attribute that stores the defaults

@ThomasWaldmann ThomasWaldmann modified the milestones: 0.1.0, 0.2.0 Nov 18, 2024
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

No branches or pull requests

1 participant