Re: [Python-Dev] some minor questions about pep8

2015-03-22 Thread Guido van Rossum
On Fri, Mar 20, 2015 at 9:24 PM, Ian Lee wrote: > Guido, > > In that case would you be open to a patch to update the PEP accordingly? > Only if it totally eradicate __version__ and similar from the PEP. > Additionally, does that official statement cover other dunder assignments > (e.g. "__autho

Re: [Python-Dev] some minor questions about pep8

2015-03-21 Thread Nick Coghlan
On 22 March 2015 at 07:46, Barry Warsaw wrote: > On Mar 21, 2015, at 05:00 PM, Donald Stufft wrote: > >>I sort of think (though I haven’t completely convinced myself) that adding >>something like __version__ to a package is a work around to the fact that >>we don’t have an API that lets someone as

Re: [Python-Dev] some minor questions about pep8

2015-03-21 Thread Barry Warsaw
On Mar 21, 2015, at 05:00 PM, Donald Stufft wrote: >I sort of think (though I haven’t completely convinced myself) that adding >something like __version__ to a package is a work around to the fact that >we don’t have an API that lets someone ask “what is the distribution and >version that this mod

Re: [Python-Dev] some minor questions about pep8

2015-03-21 Thread Donald Stufft
> On Mar 21, 2015, at 5:17 PM, MRAB wrote: > > On 2015-03-21 21:00, Donald Stufft wrote: >> >>> On Mar 21, 2015, at 4:53 PM, Barry Warsaw wrote: >>> >>> On Mar 20, 2015, at 08:53 PM, Guido van Rossum wrote: >>> FWIW, I think __version__, __author__ etc. were bad ideas. Almost nobody >>>

Re: [Python-Dev] some minor questions about pep8

2015-03-21 Thread MRAB
On 2015-03-21 21:00, Donald Stufft wrote: On Mar 21, 2015, at 4:53 PM, Barry Warsaw wrote: On Mar 20, 2015, at 08:53 PM, Guido van Rossum wrote: FWIW, I think __version__, __author__ etc. were bad ideas. Almost nobody manages these correctly. Note that the PEP 8 section starts with less tha

Re: [Python-Dev] some minor questions about pep8

2015-03-21 Thread Donald Stufft
> On Mar 21, 2015, at 4:53 PM, Barry Warsaw wrote: > > On Mar 20, 2015, at 08:53 PM, Guido van Rossum wrote: > >> FWIW, I think __version__, __author__ etc. were bad ideas. Almost nobody >> manages these correctly. Note that the PEP 8 section starts with less than >> an endorsement: "If you *ha

Re: [Python-Dev] some minor questions about pep8

2015-03-21 Thread Barry Warsaw
On Mar 20, 2015, at 09:59 PM, Ian Lee wrote: >shebang >docstring >imports >dunder assignments >other code... I generally put imports after dunders, except for __future__. I want the first screenful of code to contain them, and imports can be a few dozen lines in some modules. -Barry ___

Re: [Python-Dev] some minor questions about pep8

2015-03-21 Thread Barry Warsaw
On Mar 20, 2015, at 08:53 PM, Guido van Rossum wrote: >FWIW, I think __version__, __author__ etc. were bad ideas. Almost nobody >manages these correctly. Note that the PEP 8 section starts with less than >an endorsement: "If you *have* to have Subversion, CVS, or RCS crud in your >source file, do

Re: [Python-Dev] some minor questions about pep8

2015-03-20 Thread Ian Lee
FWIW, I would vote for the "__version__", "__author__", etc assignments being after the imports. Reason being cases where the "__version__" is not from VCS, but is calculated from pkg_resources: from pkg_resources import get_distribution __version__ = get_distribution('mypackage').version Also, t

Re: [Python-Dev] some minor questions about pep8

2015-03-20 Thread Ian Lee
Guido, In that case would you be open to a patch to update the PEP accordingly? Additionally, does that official statement cover other dunder assignments (e.g. "__author__"?). If so I'll update the PEP8 tool accordingly. Thanks, ~ Ian Lee On Mar 20, 2015 8:55 PM, "Guido van Rossum" wrote: > F

Re: [Python-Dev] some minor questions about pep8

2015-03-20 Thread Guido van Rossum
FWIW, I think __version__, __author__ etc. were bad ideas. Almost nobody manages these correctly. Note that the PEP 8 section starts with less than an endorsement: "If you *have* to have Subversion, CVS, or RCS crud in your source file, do it as follows." That said, if an official answer is requir

Re: [Python-Dev] some minor questions about pep8

2015-03-20 Thread Ben Finney
Lewis Coates writes: > In pep8 there are two conflicting statements, both > > https://www.python.org/dev/peps/pep-0008/#version-bookkeeping > https://www.python.org/dev/peps/pep-0008/#imports > > Stipulate that they should be "at the top of the file after any module > comments and docstrings." Wh

[Python-Dev] some minor questions about pep8

2015-03-20 Thread Lewis Coates
In pep8 there are two conflicting statements, both https://www.python.org/dev/peps/pep-0008/#version-bookkeeping https://www.python.org/dev/peps/pep-0008/#imports Stipulate that they should be "at the top of the file after any module comments and docstrings." Which of these takes precedence? Sec