why no camelCase in PEP 8?

Chris Angelico rosuav at gmail.com
Thu May 28 16:27:31 EDT 2020


On Fri, May 29, 2020 at 6:20 AM Peter J. Holzer <hjp-python at hjp.at> wrote:
>
> On 2020-05-19 05:59:30 +1000, Chris Angelico wrote:
> > PEP 8 is a style guide for the Python standard library. It is the
> > rules you must comply with if you are submitting a patch *to Python
> > itself*. Nobody ever requires you to comply with it for any other
> > code.
>
> That's obviously not true: Many companies and projects have a coding
> standard. Many of those coding standards will be based on or even
> identical to PEP 8. And as an employee or contributor you may be
> required to comply with it. Now you might argue that in this case you
> aren't required to comply with PEP 8, but with the coding standard of
> your company, but I would consider that excessive nitpickery.
>

The OP said:
> My preference for using camelCase (in PEP 8, AKA mixedCase) is putting me at odds with my colleagues, who point to PEP 8 as "the rules".
>

This smells like the incredibly strong misconception that PEP 8 needs
to govern every line of Python code ever written, or else it's "bad
code". This thread wouldn't have been started if it had been any other
style guide that the company had been chosen, because then it's
obvious that the choice is the company's. It's only when PEP 8 is
considered to be some sort of universal standard that we get this kind
of discussion.

ChrisA


More information about the Python-list mailing list