Mark Dickinson <dicki...@gmail.com> added the comment:

Yes, that's intentional.  When use of __int__ was deprecated, a bug report 
popped up from someone who wanted to be able to have their own objects treated 
as integers for the purposes of struct.pack.  (I don't recall which issue;  
Meador, do you remember?)  So we added use of __index__ at that point.

I think __index__ is the right interface for something to expose if it wants to 
be usable as an integer, and this usage is consistent with the original 
__index__ PEP.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12974>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to