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 benjamin.peterson, bob.ippolito, collinwinter, georg.brandl, giampaolo.rodola, inducer, jafo, mark.dickinson, nnorwitz, piman
Date 2010-03-01.20:09:15
SpamBayes Score 5.1303277e-06
Marked as misclassified No
Message-id <1267474158.56.0.918560646594.issue1530559@psf.upfronthosting.co.za>
In-reply-to
Content
More or less, yes:  when trying to pack a non-integer `x` (i.e. something that's not an instance of int or long) with an integer format code (one of 'bBhHiIlLqQ', or 'P'), `x.__index__()` would be called to convert `x` to an integer, and that integer would be packed as usual (possibly raising OverflowError).  Other format codes wouldn't be affected.

I'm not quite sure what you mean by 'beforehand':  the conversion would happen at the same time as it currently does.

It might be a struggle for me to get to this before the 2.7 betas.  If anyone's interested in submitting a patch, it would be welcome.
History
Date User Action Args
2010-03-01 20:09:18mark.dickinsonsetrecipients: + mark.dickinson, nnorwitz, georg.brandl, collinwinter, jafo, bob.ippolito, piman, inducer, giampaolo.rodola, benjamin.peterson
2010-03-01 20:09:18mark.dickinsonsetmessageid: <1267474158.56.0.918560646594.issue1530559@psf.upfronthosting.co.za>
2010-03-01 20:09:15mark.dickinsonlinkissue1530559 messages
2010-03-01 20:09:15mark.dickinsoncreate