Skip to content

__getitem__ and __setitem__ format #17

@bovee

Description

@bovee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions