(test) ? a:b

Joshua Landau joshua at landau.ws
Mon Oct 27 02:55:01 CET 2014


On 26 October 2014 01:03, Ben Finney <ben+python at benfinney.id.au> wrote:
> Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:
>
>> I suspect that Guido and the core developers disagree with you, since
>> they had the opportunity to fix that in Python 3 and didn't.
>
> That doesn't follow; there are numerous warts in Python 2 that were not
> fixed in Python 3. As I understand it, the preservation of bool–int
> equality has more to do with preserving backward compatibility.

Guido van Rossum answered Jul 28 '11 at 21:20,
http://stackoverflow.com/questions/3174392/is-it-pythonic-to-use-bools-as-ints
> False==0 and True==1, and there's nothing wrong with that.



More information about the Python-list mailing list