[Tutor] Inserting long URL's into comments & docstrings?
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? Thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Inserting long URL's into comments & docstrings?
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. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Inserting long URL's into comments & docstrings?
Ignore PEP8. S. -Original Message- From: Tutor On Behalf Of James Hartley Sent: 29 July 2019 21:37 To: tutor@python.org Subject: [Tutor] Inserting long URL's into comments & docstrings? 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? Thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor This message has been scanned by Capita systems, but if you believe it to be spam, please send it to s...@forcepoint.com. Messages sent to s...@forcepoint.com are queued for email analysis by Forcepoint Threat Lab. This email is security checked and subject to the disclaimer on web-page: http://www.capita.co.uk/email-disclaimer.aspx ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Inserting long URL's into comments & docstrings?
James Hartley schreef op 29/07/2019 om 22:36: 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? In my opinion this is one of the cases where this quote from PEP 8 applies: "However, know when to be inconsistent -- sometimes style guide recommendations just aren't applicable. When in doubt, use your best judgment." My preference would be not to split the URLs. The reader doesn't need to see the whole URL to understand the structure of the code; the full URL is really only needed to copy/paste it into a browser. -- "Honest criticism is hard to take, particularly from a relative, a friend, an acquaintance, or a stranger." -- Franklin P. Jones Roel Schroeven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Inserting long URL's into comments & docstrings?
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 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor