PEP 308: some candidate uses cases from live code

Martin Maney maney at
Mon Feb 10 00:39:51 CET 2003

Tim Peters <tim_one at> 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

More information about the Python-list mailing list