Message153331
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? |
|
Date |
User |
Action |
Args |
2012-02-14 05:44:52 | meador.inge | set | recipients:
+ meador.inge, vinay.sajip, amaury.forgeotdarc, mark.dickinson, belopolsky, ezio.melotti, brian.curtin, kumma |
2012-02-14 05:44:52 | meador.inge | set | messageid: <1329198292.17.0.730141258843.issue9041@psf.upfronthosting.co.za> |
2012-02-14 05:44:51 | meador.inge | link | issue9041 messages |
2012-02-14 05:44:51 | meador.inge | create | |
|