Thomas Grainger:
> This is already available with typing.Final and immutable types:
>
> from typing import Final
>
> ham: Final = 3
> ham = 4 # Error
>
> hams: Final[Sequence[str]] = ["ham", "spam"]
> hams.append("meat") # ErrorI'm not sure whether it's a reply to me or someone else. But anyways this is a convention. mypy will detect it. *But* I have a feeling that constants can have performance improvements though I'm not sure. _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/2T4N5GCN6VWNZM5T7RXKSRDXSTSRVZBX/ Code of Conduct: http://python.org/psf/codeofconduct/
