On Tue, May 25, 2021 at 04:27:41PM +0100, Stestagg wrote:
On Tue, May 25, 2021 at 4:02 PM Ethan Furman firstname.lastname@example.org wrote:
Optional typing != core Python.
I mean, it's part of the standard library, so we could argue on personal definitions of 'core Python', but it would be more useful to work out exactly what aspects of typing.Final are lacking for you.
The actual enforcement perhaps?
Without mypy, which is not part of the standard library or core language, annotating something with typing has no more benefit than a naming convention -- and likely less, since naming conventions are visible every time you refer to the name, not just at the point of creation.
Why would this constant annotation need to be more strongly enforced than type checks? What actual benefit would this provide?
I guess that comes down to your position on how strongly you care about backwards compatibility for people who ignore your (not-so?) clear documentation.
If you take the Microsoft position of trying very hard not to break the code of people even if they have used undocumented internals or clearly documented private areas, you might want the interpreter to do more to discourage those practices. If you take the Apple position of not giving a damn whose code you break, then you might not.