Skip to content

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

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

Open
3 tasks
keighrim opened this issue Jul 13, 2024 · 0 comments · May be fixed by #304
Open
3 tasks

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

keighrim opened this issue Jul 13, 2024 · 0 comments · May be fixed by #304
Assignees

Comments

@keighrim
Copy link
Member

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 )

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

Successfully merging a pull request may close this issue.

2 participants