1
0
Files
synapse/changelog.d
Sean Quah 17bc6167d6 Annotate string constants in synapse.api.constants with Final
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, ...)
```
2021-11-16 13:37:51 +00:00
..
2021-11-12 19:56:00 +00:00