Like everyone other than Abe in this thread, I find judicious use of CONSTANTS to be highly readable and useful.
Yes, there is a little wiggle room about just how constant a constant has to be since Python doesn't have a straightforward way to create real constants. Very rarely I might change a value named in all caps. But the distinction between a value intended as fixed and one I merely probably won't change is worth marking typographically.... Especially since there's no actual Python semantics enforcing it. On Fri, Jan 4, 2019, 2:02 PM Abe Dillon <[email protected] wrote: > I keep coming back to this great video <https://vimeo.com/74316116> about > coding style, and one point in particular rings true to me: > ALL_CAPS_IS_OBNOXIOUS > > It destroys the visual flow of code and for what? To signify a global, > constant, or Enum? Is that really so important? I don't think so. I think > the all caps style has out-lived its usefulness and needs to go the way of > the dodo. > > The last time I saw all caps used appropriately was in a YouTube comment > where some guy was ranting about the communist Jewish banker conspiracy to > control the world. In that case, all caps clearly communicated to me that > the person was a frothing lunatic (thought find the idea of communist > bankers intriguing). > > Currently PEP-8 prescribes all caps for constants > <https://www.python.org/dev/peps/pep-0008/#constants> and uses the all > cap variable "FILES" as an example in a different section. > <https://www.python.org/dev/peps/pep-0008/#when-to-use-trailing-commas> It > also appears to be the defacto-standard for enums (based on the > documentation > <https://docs.python.org/3/library/enum.html#creating-an-enum>) > > I don't think it's necessary to make any breaking changes. Just pep-8 and > (of less importance) spurious documentation examples. > _______________________________________________ > Python-ideas mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
