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

David L Neil PyTutor at DancesWithMice.info
Mon Jul 29 18:42:06 EDT 2019


On 30/07/19 8:36 AM, James Hartley wrote> 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?


Assuming the use-case for including a URL-comment is to be able to 
locate the resource again, I'd leave it integral so that it is ready for 
a quick copy-paste. Otherwise you'd have to re-assemble the URL in the 
browser, from multiple comment-lines in the code...

In addition to PEP-8, please consider 'the Zen of Python' (practicality 
and purity).

	python3 -c "import this"

-- 
Regards =dn


More information about the Tutor mailing list