int rich comparisons

George Sakkis george.sakkis at gmail.com
Fri Oct 2 16:52:08 CEST 2009


I stumbled upon the following strangeness (python 2.6.2):

>>> getattr(int, '__gt__')
<method-wrapper '__gt__' of type object at 0x822b7c0>

>>> getattr(5, '__gt__')
Traceback (most recent call last):n
  File "<stdin>", line 1, in <module>
AttributeError: 'int' object has no attribute '__gt__'

Is this a bug ?

George



More information about the Python-list mailing list