Skip to content

make .get() and indexing ([]) more pythonic #295

@keighrim

Description

@keighrim

Because

At the moment, various classes in mmif.serialize package implements .get() and .__getitem__() methods, but their behavior are

  1. not consistent across classes
  2. not well-documented in one place (they all have decent docstring, but no aggregate of them exists)
  3. not so "pythonic" in that their behavior often deviates from standard python get and __getitem__ methods in built-in classes.

Done when

  • all existing (de-)serialization classes are categorized into "dict-likes" and "list-likes"
  • inspect current implementation of get and __getitem__ for each
  • update, if necessary, the methods to match those of python dict's and list's

Additional context

This proposed change will vastly break compatibility of the SDK to existing CLAMS app code, so we need a version marker that can mark this breakage. (#293 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions