PEP8 compliance and exception messages ?

Tim Harig usernet at ilthio.net
Mon Dec 6 01:15:06 EST 2010


On 2010-12-06, Andreas Waldenburger <usenot at geekmail.INVALID> wrote:
> On Sun, 5 Dec 2010 19:52:54 -0800 Chris Rebert <clp2 at rebertia.com> wrote:
>
>> On Sun, Dec 5, 2010 at 7:40 PM, shearichard <shearichard at gmail.com>
>> wrote:
>> > Hi - PEP8 says lines should not exceed 79 characters in length
>> > ( http://www.python.org/dev/peps/pep-0008/ ).
>> >
>> > So if you've got some code that looks like this :
>> >
>> > raise fooMod.fooException("Some message which is quite long")
>> >
>> > ... and assuming a certain amount of indenting you're going to break
>> > that guideline.
>> >
>> > [etc.]
>> 
>> Use implicit string literal concatenation:
>> 
>> [...]
>> 
> But isn't explicit string literal concatenation better than implicit
> string literal concatenation?

So add the "+", it really doesn't change it much.

>> Alternatively, you could disregard PEP 8 on this point on the grounds
>> that the 79/80 characters per line limit is outdated.
>> 
> Maybe, but it's not outmoded.

I would say that it is not even outdated.  Just because you happen to enjoy
longer lines doesn't mean that everybody does.  Not all progammers have
20/10 vision and even those who have hardware to handled it don't
necessarily like having a single piece of code take up their entire display
just to be readable.  Many of us like the extra ability that wider screen
technology gives us to actually be able to view more of the file at once
by splitting the display into a couple of columns.



More information about the Python-list mailing list