allow line break at operators

Dan Sommers dan at tombstonezero.net
Wed Aug 10 05:56:20 EDT 2011


On Wed, 10 Aug 2011 18:32:05 +1000, Steven D'Aprano wrote:

> Python is a programming language, not an ice cream shop.

+1 QOTW

How about a cheese shop?

In terms of easier to read, I find code easier to read when the operators 
are at the beginnings of the lines (PEP 8 notwithstanding):

    x = (someobject.somemethod(object3, thing)
         + longfunctionname(object2)
         + otherfunction(value1, value2, value3))

I can see the "+" signs a lot easier there than at the end of some line, 
where it might be buried between two longer lines:

    x = (someobject.somemethod(object3, thing) +
         longfunctionname(object2) +         
         otherfunction(value1, value2, value3))
-- 
Dan




More information about the Python-list mailing list