[Python-ideas] Should Python have user-defined constants?

Serhiy Storchaka storchaka at gmail.com
Tue Nov 21 05:06:15 EST 2017

21.11.17 11:47, Paul Moore пише:
> -1. I don't see how this would improve any programs I've written or
> seen. Tools like mypy or linters might benefit from a feature to track
> constants and ensure they don't get changed, but I don't think it's
> needed as a language feature. Seriously, has anyone ever written
> "math.pi = 5" and been surprised that their code broke? Or even
> modified an application constant like BUFFER_LIMIT? Do you have any
> evidence that this would avoid bugs in real-world code?

Actually the possibility of modifying application constants like 
BUFFER_LIMIT can be useful.

More information about the Python-ideas mailing list