if the else short form
Ethan Furman
ethan at stoneleaf.us
Fri Oct 1 14:46:46 EDT 2010
John Nagle wrote:
> On 10/1/2010 12:42 AM, bruno.desthuilliers at gmail.com wrote:
>> On 30 sep, 19:22, Andreas Waldenburger<use... at geekmail.INVALID>
>> wrote:
>>>
>>> But it does violate the "explicit is better than implicit" tenet, don't
>>> you think?
>>
>> Why so ? The doc clearly states that booleans are integers with True
>> == 1 and False == 0, so there's nothing implicit here.
>
> Python "bool" values are NOT integers. They can be coerced to
> integers for historical reasons. But "str(True)" is "True".
Okay, so they are *subtypes* of integers, to be precise... but what,
exactly, does the string representation of an object have to do with its
type?
~Ethan~
More information about the Python-list
mailing list