Why is None <= 0

John Nagle nagle at animats.com
Sat Apr 26 01:15:05 EDT 2008


Gregor Horvath wrote:
> D'Arcy J.M. Cain schrieb:
>> On Fri, 25 Apr 2008 20:27:15 +0200
>> Gregor Horvath <gh at gregor-horvath.com> wrote:
>>>  >>> None <= 0
>>> True
>>>
>>> Why?
>>
>> Why not?
> 
> Because, from http://www.python.org/dev/peps/pep-0020/ :
> 
> Errors should never pass silently.
> In the face of ambiguity, refuse the temptation to guess.
> 
> Greg

    Good point.

    The problem is the typical one; Python did not originally
have a Boolean type, and the retrofit resulted in weird semantics.
C has the same issue.

					John Nagle



More information about the Python-list mailing list