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
Date 2010-04-03.13:57:05
SpamBayes Score 1.0367366e-05
Marked as misclassified No
Message-id <1270303029.02.0.885523101722.issue8300@psf.upfronthosting.co.za>
In-reply-to
Content
That patch was a bit hasty in many respects;  here's a better one.

For 2.7, the scheme is as follows:  when packing a non-integer with an integer format:

(1) First __index__ is tried
(2) If the __index__ method doesn't exist, or the call to __index__ raises TypeError, then the __int__ method is tried.
(3) If the __index__ method raises something other than TypeError, or returns a non-integer, then struct.pack fails.
History
Date User Action Args
2010-04-03 13:57:09mark.dickinsonsetrecipients: + mark.dickinson, meador.inge
2010-04-03 13:57:09mark.dickinsonsetmessageid: <1270303029.02.0.885523101722.issue8300@psf.upfronthosting.co.za>
2010-04-03 13:57:07mark.dickinsonlinkissue8300 messages
2010-04-03 13:57:06mark.dickinsoncreate