pep 8 constants

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sun Jun 28 19:30:23 EDT 2009


On Sun, 28 Jun 2009 10:09:21 -0400, Eric S. Johansson wrote:

> Bruno Desthuilliers wrote:
>> Brendan Miller a écrit :
>>> PEP 8 doesn't mention anything about using all caps to indicate a
>>> constant.
>>>
>>> Is all caps meaning "don't reassign this var" a strong enough
>>> convention to not be considered violating good python style? I see a
>>> lot of people using it, but I also see a lot of people writing
>>> non-pythonic code... so I thought I'd see what the consensus is.
>> 
>> Most - if not all - of the python code I've seen so far used this
>> convention, and I always used (and respected) it myself.
> 
> I reject this convention because any form of caps significantly
> increases vocal load for disabled programmers using speech recognition
> through extra utterances, and degraded recognition.
[...]
> so I reject pep 8 because I have no voice safe alternative

And you are perfectly entitled to.

That puts you at a disadvantage if you wish to submit code for the 
standard library, where PEP 8 compliance is required, but for your own 
code you are entitled to use whatever conventions you prefer.



-- 
Steven



More information about the Python-list mailing list