On Fri, Nov 12, 2010 at 2:09 AM, Simon Schampijer <si...@schampijer.de>
wrote:
> In general I would do what the spec says if there is no good reason not to
> [1]. The example they have does not really handle all the cases, though.
> Neither pep8 nor pylint does favor any formatting. So I guess we are a bit
> free here.

I belive PEP8's example is rather definitive:

"... Make sure to indent the continued line appropriately.  The preferred
place to break around a binary operator is *after* the operator, not before
it.  Some examples:

   class Rectangle(Blob):

       def __init__(self, width, height,
                    color='black', emphasis=None, highlight=0):
           if width == 0 and height == 0 and \
              color == 'red' and emphasis == 'strong' or \
              highlight > 100:
               raise ValueError("sorry, you lose")
           if width == 0 and height == 0 and (color == 'red' or
                                              emphasis is None):
               raise ValueError("I don't think so -- values are %s, %s" %
                                (width, height))
           Blob.__init__(self, width, height,
                         color, emphasis, highlight)

I don't think there's any ambiguity there, actually.
  --scott

-- 
                         ( http://cscott.net/ )
_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to