On Jan 24, 2011 5:31 PM, "Alan" <alan.is...@gmail.com> wrote:
>
> Why do function objects compare in this way to numbers?
> Thanks,
> Alan Isaac
>
>
> >>> def f(): return
> ...
> >>> f>5
> True
>

Python 2 returned an arbitrary but consistent ordering for almost all
comparisons, just in case you were doing something weird like sorting a list
with mixed types. Python 3 will throw an exception if you try doing
something silly like compare a function to a number.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to