PEP 308: A PEP Writer's Experience - PRO

Andrew Koenig ark at
Sat Feb 8 19:42:31 CET 2003

Tim> OTOH, when I read Micahel's post, I had no idea whether

Tim>     print "x = " + x.getDisplayString() if x else "None"

Tim> would group as:

Tim>     print ("x = " +   (x.getDisplayString() if x else "None"))

Tim> or as:

Tim>     print (("x = " + x.getDisplayString())   if x else "None")

Tim> and I didn't even know which way he *intended*.  Spelled with an if-
Tim> statement instead, the intent is obvious instead of a puzzle.

Or spelled with an extra pair of parentheses.

Andrew Koenig, ark at,

More information about the Python-list mailing list