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 skrah
Recipients mark.dickinson, serhiy.storchaka, skrah
Date 2012-05-05.20:25:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1336249539.16.0.910746617763.issue14722@psf.upfronthosting.co.za>
In-reply-to
Content
The proposal makes sense at first glance, but I agree with Mark that it is
not clear what should be done. For example, all arrays in Python silently
convert to inf:

>>> from numpy import array
>>> x = array([1,2,3], 'f')
>>> x
array([ 1.,  2.,  3.], dtype=float32)
>>> x[0] = 10**100 
>>> x
array([ inf,   2.,   3.], dtype=float32)


Same for array.array and memoryview. I would not be surprised if users rely
on this behavior. Anyway, silently converting to infinity is exactly what
I'd expect (also for double BTW).

 
Regarding undefined behavior: I only know compilers that convert to infinity
without signaling overflow. The tests for the new memoryview implementation 
should include this case (I think!), and I ran the tests with all compilers 
that I've access to.
History
Date User Action Args
2012-05-05 20:25:39skrahsetrecipients: + skrah, mark.dickinson, serhiy.storchaka
2012-05-05 20:25:39skrahsetmessageid: <1336249539.16.0.910746617763.issue14722@psf.upfronthosting.co.za>
2012-05-05 20:25:38skrahlinkissue14722 messages
2012-05-05 20:25:38skrahcreate