[Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS
Abe Dillon
abedillon at gmail.com
Fri Jan 4 19:15:11 EST 2019
Sure everyone knows what it means, but it's meaning is essentially useless
because the default assumption when you encounter a variable you don't
know, is that you shouldn't overwrite it. If you found a module-level
variable in Pandas named cucumber, would you immediately assume you can
write whatever value you want to pandas.cucumber because it isn't in all
caps?
On Fri, Jan 4, 2019 at 6:04 PM Michael Foord <fuzzyman at gmail.com> wrote:
>
>
> On Fri, 4 Jan 2019 at 19:02, Abe Dillon <abedillon at gmail.com> 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
>>
>
>
> I really like the convention. It's nice and clear and absolutely everyone
> knows what it means.
>
> Michael
>
>
>
>
>> 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
>> Python-ideas at python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
> --
>
> http://www.michaelfoord.co.uk/
>
> May you do good and not evil
> May you find forgiveness for yourself and forgive others
> May you share freely, never taking more than you give.
> -- the sqlite blessing http://www.sqlite.org/different.html
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190104/af9b5641/attachment.html>
More information about the Python-ideas
mailing list