Closed erlend-aasland closed 1 year ago
Makes sense! You could annotate them with
Final[str]
to indicate to mypy that they're meant to be class-level "constants" that are never changed when accessed on the class or the instance -- they are set once, and then should be treated by the type checker as read-only after that
Neat!
Opened python/cpython#107556
What do you think of this? IMO, all these static strings pollute
output_templates
. I'm trying to improve the readability of that method.