PEP 308: some candidate uses cases from live code

Martin Maney maney at pobox.com
Sun Feb 9 18:39:51 EST 2003


Tim Peters <tim_one at email.msn.com> wrote:

>>         sy = d0.year - (1 if d0.month < 7 else 0)

> Me too, but note that it could be written (even in Python 1.0):
> 
>    sy = d0.year - (d0.month < 7)
> 
> That bools are confusable with 0 and 1 in Python is A Feature.

Maybe, but I have never liked this sort of use.  Been there, did that,
lived to regret it, eventually.  The general lack of ugly, confusing
tricks like this is what I most like about Python.  Well, that and the
batteries...




More information about the Python-list mailing list