python syntax for conditional is unfortunate

Neal Becker ndbecker2 at
Wed Sep 24 01:52:28 CEST 2008

In hindsight, I am disappointed with the choice of conditional syntax.  I know it's too late to change.  The problem is

y = some thing or other if x else something_else

When scanning this my eye tends to see the first phrase and only later notice that it's conditioned on x (or maybe not notice at all!).  Particularly if 'some thing or other' is long or complicated.

More information about the Python-list mailing list