Travis E. Oliphant wrote:
> 
> The idea is that the __index__() method should return an exact int or 
> exact long or this call will raise an error.  The restriction is present 
> to remove the possibility of infinite recursion (though I'm not sure 
> where that would occur exactly).
> 

I just realized that returning a sub-class of Int and/or Long would not 
be a problem here.  The recursion problem that I was guarding against 
only arose when the possibility of returning any object with an 
.__index__() method was suggested.

Therefore, I think these exact int or exact long checks can and should 
be replaced with PyInt_Check() and PyLong_Check().

-Travis



_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to