Skip to content
Snippets Groups Projects

Tag model entities with their "type"

this aims at preventing constant usage of isinstance() based dispatch code when writing generic code handling model entities.

For example, the "object_type" argument of JournalWriter.write_addition() has become superflous now we only pass model entities, etc.

This idea comes olasd's reading of mypy doc:

https://mypy.readthedocs.io/en/latest/literal_types.html#tagged-unions


Migrated from D3152 (view on Phabricator)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading