<p dir="ltr">Guido,</p>
<p dir="ltr">In that case would you be open to a patch to update the PEP accordingly?</p>
<p dir="ltr">Additionally, does that official statement cover other dunder assignments (e.g. "__author__"?). If so I'll update the PEP8 tool accordingly.</p>
<p dir="ltr">Thanks,</p>
<p dir="ltr">~ Ian Lee</p>
<div class="gmail_quote">On Mar 20, 2015 8:55 PM, "Guido van Rossum" <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>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 <b>have</b> to have Subversion, CVS, or RCS crud in your source file,
do it as follows."<br><br></div>That said, if an official answer is required, common sense would suggest that __version__ should go before the imports. (I would put it before the docstring too, except then the docstring wouldn't be a docstring any more. Go figure.)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 20, 2015 at 6:38 PM, Ben Finney <span dir="ltr"><<a href="mailto:ben+python@benfinney.id.au" target="_blank">ben+python@benfinney.id.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>Lewis Coates <<a href="mailto:lewisc@pdx.edu" target="_blank">lewisc@pdx.edu</a>> writes:<br>
<br>
> In pep8 there are two conflicting statements, both<br>
><br>
> <a href="https://www.python.org/dev/peps/pep-0008/#version-bookkeeping" target="_blank">https://www.python.org/dev/peps/pep-0008/#version-bookkeeping</a><br>
> <a href="https://www.python.org/dev/peps/pep-0008/#imports" target="_blank">https://www.python.org/dev/peps/pep-0008/#imports</a><br>
><br>
> Stipulate that they should be "at the top of the file after any module<br>
> comments and docstrings." Which of these takes precedence?<br>
<br>
</span>I don't know an official answer. The convention I've observed is<br>
overwhelmingly in one direction: import statements come before any<br>
assignment statements.<br>
<span><br>
> Secondly, we also have an "__author__", and "__project__" variables, I<br>
> assume these would be put with the version information as well?<br>
<br>
</span>Yes.<br>
<span><font color="#888888"><br>
--<br>
\ “Welchen Teil von ‘Gestalt’ verstehen Sie nicht? [What part of |<br>
`\ ‘gestalt’ don't you understand?]” —Karsten M. Self |<br>
_o__) |<br>
Ben Finney<br>
<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div>--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>
<br>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ianlee1521%40gmail.com" target="_blank">https://mail.python.org/mailman/options/python-dev/ianlee1521%40gmail.com</a><br>
<br></blockquote></div>