This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, meador.inge, skrah
Date 2011-09-16.11:59:06
SpamBayes Score 0.0037592305
Marked as misclassified No
Message-id <1316174347.72.0.567410783453.issue12974@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-09-16 11:59:07mark.dickinsonsetrecipients: + mark.dickinson, skrah, meador.inge
2011-09-16 11:59:07mark.dickinsonsetmessageid: <1316174347.72.0.567410783453.issue12974@psf.upfronthosting.co.za>
2011-09-16 11:59:07mark.dickinsonlinkissue12974 messages
2011-09-16 11:59:06mark.dickinsoncreate