[Python-Dev] A proposal has surfaced on comp.lang.python to redefine "is"

Peter Norvig pnorvig at google.com
Thu Mar 18 04:26:09 EST 2004


Let me point out that in Common Lisp, there are five equality predicates:

  eq     like Python's 'is', only true for identical objects
  eql    also true for numbers with same value
  equal  like Python's '=='
  equalp also true for strings with different case
  =      only works on numbers, true if they are eql after
         conversion to the same type

I would say that Python is served well by the two equality predicates
it has, that it is impossible to please everyone, and that users
should get used to writing the predicate they want if it is not one of
the builtins.

See also Kent Pitman's "EQUAL Rights -- and wrongs -- in Lisp,
http://www.nhplace.com/kent/PS/EQUAL.html

-Peter Norvig



More information about the Python-Dev mailing list