[Python-Dev] Re: PEP 285: Adding a bool type

Paul Rubin phr-n2002a at nightsong.com
Wed Apr 3 23:48:56 EST 2002


Andrew Koenig <ark at research.att.com> writes:
> >> No.  That would break backwards compatibility.  False==0, and True==1;
> >> everything else follows from that.  (But False is not 0, and True is
> >> not 1!)
> 
> Ping> This is a strange distinction to make -- one that is not made in
> Ping> any other programming language i have ever encountered.
> 
> I would be very surprised if none of the Lisp family of languages
> has similar anomalies in the relationship between eq and equal.

Python already has a bunch of eq but not equal numeric types:

  1 == 1L      1 is not 1L
  1 == 1.0     1 is not 1.0
  1 == 1+0j    1 is not 1+0j

I felt better about the PEP after Guido pointed this out.



More information about the Python-list mailing list