Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I format a long url in a python comment and still be PEP8 compliant

Tags:

python

pep8

In a block comment, I want to reference a URL that is over 80 characters long.

What is the preferred convention for displaying this URL?

I know bit.ly is an option, but the URL itself is descriptive. Shortening it and then having a nested comment describing the shortened URL seems like a crappy solution.

like image 679
Zach Avatar asked May 24 '12 14:05

Zach


1 Answers

Don't break the url:

# A Foolish Consistency is the Hobgoblin of Little Minds [1] # [1]: http://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds 
like image 135
jfs Avatar answered Sep 21 '22 21:09

jfs