Hi all,
I'm wondering what advice you have about formatting if statements with
long conditions (I always format my code to 80 colums)
Here's an example taken from something I'm writing at the moment and
how I've formatted it:
if (isinstance(left, PyCompare) and isinstance(right,
Arnaud Delobelle wrote:
Hi all,
I'm wondering what advice you have about formatting if statements with
long conditions (I always format my code to 80 colums)
Here's an example taken from something I'm writing at the moment and
how I've formatted it:
if (isinstance(left,
On 27/08/11 09:08:20, Arnaud Delobelle wrote:
I'm wondering what advice you have about formatting if statements with
long conditions (I always format my code to80 colums)
Here's an example taken from something I'm writing at the moment and
how I've formatted it:
if (isinstance(left,
Hans Mulder wrote:
[...]
It may look ugly, but it's very clear where the condition part ends
and the 'then' part begins.
Immediately after the colon, surely?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On 27 August 2011 08:24, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Arnaud Delobelle wrote:
Hi all,
I'm wondering what advice you have about formatting if statements with
long conditions (I always format my code to 80 colums)
Here's an example taken from something I'm
On 27/08/11 11:05:25, Steven D'Aprano wrote:
Hans Mulder wrote:
[...]
It may look ugly, but it's very clear where the condition part ends
and the 'then' part begins.
Immediately after the colon, surely?
On the next line, actually :-)
The point is, that this layout makes it very clear that
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes:
I believe that PEP 8 now
Specifically the “Indentation” section contains::
When using a hanging indent the following considerations should be
applied; there should be no arguments on the first line and further
indentation
On 27-Aug-11 03:50 AM, Hans Mulder wrote:
On 27/08/11 09:08:20, Arnaud Delobelle wrote:
I'm wondering what advice you have about formatting if statements with
long conditions (I always format my code to80 colums)
Here's an example taken from something I'm writing at the moment and
how I've
On 27/08/11 17:16:51, Colin J. Williams wrote:
What about:
cond= isinstance(left, PyCompare)
and isinstance(right, PyCompare)
and left.complist[-1] is right.complist[0]
py_and= PyCompare(left.complist + right.complist[1:])if cond
else: py_and = PyBooleanAnd(left, right)
Colin
In article mailman.457.1314428909.27778.python-l...@python.org,
Arnaud Delobelle arno...@gmail.com wrote:
Hi all,
I'm wondering what advice you have about formatting if statements with
long conditions (I always format my code to 80 colums)
[...]
if (isinstance(left, PyCompare) and
On 27-Aug-11 11:53 AM, Hans Mulder wrote:
On 27/08/11 17:16:51, Colin J. Williams wrote:
What about:
cond= isinstance(left, PyCompare)
and isinstance(right, PyCompare)
and left.complist[-1] is right.complist[0]
py_and= PyCompare(left.complist + right.complist[1:])if cond
else: py_and =
11 matches
Mail list logo