Message100265
| 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. |
|