Message153331
| Author |
meador.inge |
| Recipients |
amaury.forgeotdarc, belopolsky, brian.curtin, ezio.melotti, kumma, mark.dickinson, meador.inge, vinay.sajip |
| Date |
2012年02月14日.05:44:50 |
| SpamBayes Score |
8.5998856e-08 |
| Marked as misclassified |
No |
| Message-id |
<1329198292.17.0.730141258843.issue9041@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
After thinking about it a bit more I am OK with Vinay's proposal. Attached is an updated patch.
Also, I also noticed that the 'struct' module has the same problem:
>>> big_int = int(sys.float_info.max) * 2
>>> struct.pack('d', big_int)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
struct.error: required argument is not a float
but the 'array' module does the right thing:
>>> big_int = int(sys.float_info.max) * 2
[68068 refs]
>>> array.array('d', [big_int])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: long int too large to convert to float
[68068 refs]
>>> array.array('d', [""])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: a float is required
Mark, do you have any opinions on the error handling here and in the struct module? |
|