mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-09-08 12:22:11 +00:00
![Sean Quah](/assets/img/avatar_default.png)
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, ...) ```
2 lines
108 B
Plaintext
2 lines
108 B
Plaintext
Add `Final` annotation to string constants in `synapse.api.constants` so that they get typed as `Literal`s.
|