mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-23 10:05:55 +03:00
7862f821de
This change makes mypy complain if the constants are ever reassigned, and, more usefully, makes mypy type them as `Literal`s instead of `str`s, allowing code of the following form to pass mypy: ```py def do_something(membership: Literal["join", "leave"], ...): ... do_something(Membership.JOIN, ...) ```
1 line
108 B
Text
1 line
108 B
Text
Add `Final` annotation to string constants in `synapse.api.constants` so that they get typed as `Literal`s.
|