Defending the ternary operator

Paul Rubin http
Tue Feb 11 21:27:52 EST 2003


iko at cd.chalmers.se (Anders Hammarquist) writes:
> Also, using it forced me to learn the Pythonic meaning of
> and and or, and so I do not find constructs such as
> "spam = eggs and eggs.count()" at all strange. So, in the end,
> I think I now write better and more beautiful code as a result
> of being forced to abstract away the ternary.

The other interpretation is that Python's lack of conditional
expressions warped your sense of beauty until you found it natural to
write ugly constructs like that ;-).




More information about the Python-list mailing list