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.

classification
Title: make float packing copy bytes when they can
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: mwh Nosy List: mwh
Priority: normal Keywords: patch

Created on 2005-04-12 07:37 by mwh, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
memcpy-floats-when-ieee.diff mwh, 2005-04-12 07:37 mwh patch #1
memcpy-floats-when-ieee-2.diff mwh, 2005-04-12 17:18 mwh patch #2
memcpy-floats-when-ieee-3.diff mwh, 2005-04-14 07:51 mwh patch #3
memcpy-floats-when-ieee-4.diff mwh, 2005-04-19 16:06 mwh patch #4
Messages (5)
msg48200 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-04-12 07:37
As discussed on python-dev, this makes the 
_PyFloat_{Pack,Unpack}{4,8} functions copy bytes around when 
peering at 1.5 has the right result.
msg48201 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-04-12 17:18
Logged In: YES 
user_id=6656

New patch, which attacks comments in floatobject.h and implements Tim's 
idea of refusing to unpack an IEEE special on a non-IEEE platform.
msg48202 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-04-14 07:51
Logged In: YES 
user_id=6656

This version attacks comments some more, uses more interesting probe 
values and, um, actually works on a little-endian platform (previous 
versions had a very stupid bug).
msg48203 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-04-19 16:06
Logged In: YES 
user_id=6656

Stop me if this is getting silly.

This adds class methods __getformat__ and __setformat__ to the float 
type and uses them in a new test file, test_float (they have docstrings that 
warn people not to use them).

I'd like to check this in soon.  Any objections?
msg48204 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-05-27 15:24
Logged In: YES 
user_id=6656

Checked in as:

Lib/test/test_float.py revision 1.1
Include/floatobject.h revision 2.23
Include/pythonrun.h revision 2.66
Objects/floatobject.c revision 2.136
Python/pythonrun.c revision 2.214
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41848
2005-04-12 07:37:40mwhcreate