Feature Requests item #445484, was opened at 2001-07-28 17:21 Message generated for change (Comment added) made by birkenfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=445484&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 4 Submitted By: Anthony Doggett (anthonydoggett) Assigned to: Nobody/Anonymous (nobody) Summary: pickle lacks float('inf') Initial Comment: Support for float('inf') still appears to be missing in Python 2.1.1 (#1, Jul 28 2001, 14:15:01) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 >>> cPickle.dumps(float('inf'), 1) Traceback (most recent call last): File "<stdin>", line 1, in ? SystemError: frexp() result out of range >>> pickle.dumps(float('inf'), 1) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/var/ajd111/python/lib/python2.1/pickle.py", line 943, in dumps Pickler(file, bin).dump(object) File "/var/ajd111/python/lib/python2.1/pickle.py", line 109, in dump self.save(object) File "/var/ajd111/python/lib/python2.1/pickle.py", line 211, in save f(self, object) File "/var/ajd111/python/lib/python2.1/pickle.py", line 273, in save_float self.write(BINFLOAT + pack('>d', object)) SystemError: frexp() result out of range Both structmodule.c and cPickle.c require changes. Surely something like if (x == HUGE_VAL) { /* Inf */ e = 1024; f = 0.0; } else { f = frexp(x, &e); ... and if (e == 1024) x = HUGE_VAL; /* Inf */ else { is all that is required for all IEEE754 machines? (structmodule.c requires similar changes for Float also) ---------------------------------------------------------------------- >Comment By: Reinhold Birkenfeld (birkenfeld) Date: 2005-07-17 15:11 Message: Logged In: YES user_id=1188172 This is in CVS for 2.5. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2003-05-13 03:12 Message: Logged In: YES user_id=31435 This appears to be outside the scope of PEP 754 (as defined by the PEP's author -- he's just aiming at symbolic constants and inquiry functions). ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-05-13 02:46 Message: Logged In: YES user_id=357491 PEP 754 should make sure to deal with this. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-09-05 22:16 Message: Logged In: YES user_id=31435 Changed to Feature Request, and added to new "Non- accidental 754 support" section of PEP 42. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-09-05 20:21 Message: Logged In: YES user_id=6380 Is there a point in keeping this bug report open indefinitely? A "won't fix" would make just as much sense. Maybe add Inf support to PEP 42. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2001-08-02 00:41 Message: Logged In: YES user_id=31435 Note that Python has no intentional support for Infs and NaNs anywhere; even that float('inf') doesn't blow up when you do it is a platform accident (it blows up ("invalid literal") on my box). Given that, in the absence of a comprehensive plan for supporting this stuff across the board, and worker bees to implement it, I downgraded the priority. A good plan would refactor the code so that dealing with the platform double and float formats occurs in only one place. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=445484&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com