[Python-Dev] Tweaking PEP 8 guidelines for use of leading underscores

Nick Coghlan ncoghlan at gmail.com
Tue Jul 16 13:09:23 CEST 2013


On 16 July 2013 18:41, Terry Reedy <tjreedy at udel.edu> wrote:
> On 7/15/2013 11:11 PM, Nick Coghlan wrote:
>
>> I'll look into adding some stronger wording at the top making it clear
>> that while PEP 8 is a useful starting point and a good default if a
>> project doesn't have a defined style guide of it's own, it is *not*
>> the be-all-and-end-all for Python style guides. Treating it as such as
>> an abuse of the PEP, pure and simple.
>
>
> How about (re)naming it
> Style Guide for Python Standard Library Code
>
> Without 'Standard Library' in the title, I can see how some people might
> think it meant to apply to all code. I do not think we need to worry about
> the above being too narrow.

I reread the whole thing today - it turns out we *have* tweaked it
over time to account for other people using it for their projects as
well. The one genuinely standard library specific element still in it
(the prohibition on the use of function annotations) is explicitly
qualified as only applying to the standard library and not anything
else. So I think we need to continue supporting that use case.

I did find it interesting that we *don't* explicitly advise against
the use of "import *" for anything other than optional accelerator
modules or republishing internal interfaces through a public API, even
though we advice against the practice in the tutorial. Perhaps another
oversight worth correcting?

Cheers,
Nick.

--
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list