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

__getitem__ and __setitem__ format #17

Open
bovee opened this issue Jan 19, 2020 · 0 comments
Open

__getitem__ and __setitem__ format #17

bovee opened this issue Jan 19, 2020 · 0 comments

Comments

@bovee
Copy link
Contributor

bovee commented Jan 19, 2020

Right now we only expose name, rank = tax[tax_id] in Python, but we should add a way to set properties via indexing for ergonomics. I think this could either take the form of:

  • a dedicated TaxonomyNode object that mediates editing with the taxonomy (internally it would probably keep a reference the same way the TaxonomyIterator does)
  • a namedtuple as the return and treating it the same was as a dedicated object above
  • a regular tuple as the return and some sort of coercion on setting from other tuples with fewer element; this seem more brittle than the other options
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