On 1/24/2011 4:51 PM, Alan wrote:
Why do function objects compare in this way to numbers?
Thanks,
Alan Isaac


def f(): return
...
f>5
True

In 3.x
>>> def f(): pass

>>> f > 5
Traceback (most recent call last):
  File "<pyshell#39>", line 1, in <module>
    f > 5
TypeError: unorderable types: function() > int()

There is a historical explanation in many past posts and probably in the FAQ.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to