[Tutor] Inserting long URL's into comments & docstrings?

Ben Finney ben+python at benfinney.id.au
Mon Aug 5 07:56:08 EDT 2019


James Hartley <jjhartley at gmail.com> writes:

> This should be a slow ball pitch. Unfortunately, I haven't stumbled
> across a reasonable answer yet.

You can find the answer directly in PEP 8.

> On occasion, I put long URL's into comments/docstrings simply to document
> where I found specific information.

That's good practice, thank you for doing it!

> However, to be a good disciple of PEP8, anything which can't fit
> within 72 characters needs to be split across multiple lines.

To be a good disciple of PEP 8, follow it to completion. That includes
the section directly after the introduction
<URL:https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds>.

If a tool is rigidly enforcing some rules of PEP 8, but failing to let
you follow that section? That tool is foolish and needs to be ignored.

Follow PEP 8, and use your judgement.

-- 
 \      “An expert is a man who has made all the mistakes which can be |
  `\                         made in a very narrow field.” —Niels Bohr |
_o__)                                                                  |
Ben Finney



More information about the Tutor mailing list