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

Mats Wichmann mats at wichmann.us
Mon Jul 29 18:34:47 EDT 2019


On 7/29/19 2:36 PM, James Hartley wrote:
> This should be a slow ball pitch.  Unfortunately, I haven't stumbled across
> a reasonable answer yet.
> 
> On occasion, I put long URL's into comments/docstrings simply to document
> where I found specific information.  However, to be a good disciple of
> PEP8, anything which can't fit within 72 characters needs to be split
> across multiple lines.  Since a number of you seem to be prolific Python
> coders, what opinion do you have about splitting URL's in
> comments/docstrings?

One person's opinion:

Don't.

It's not worth being so dogmatic that you split if something like a URL
by itself on a line goes a little long... even if it goes 105 chars, say
(there's not a magic number).

And if the URL is really long and full of crud, rather than simple and
readable, consider feeding it to a shortener - its visual clarity is
already compromised, after all.





More information about the Tutor mailing list