New submission from Mark Dickinson dicki...@gmail.com:
After:
CC=gcc -DPY_NO_SHORT_FLOAT_REPR ./configure make
test_format_testfile in test_float fails with:
test.support.TestFailed: Traceback (most recent call last):
File Lib/test/test_float.py, line 341, in test_format_testfile
Mark Dickinson dicki...@gmail.com added the comment:
On second thoughts, I think that repr shouldn't change: 'legacy'
repr format should mean that it *is* exactly the same as before,
including the switch at 1e17 instead of 1e16. Otherwise there will be 3
possibilities for repr output: 'short'
Changes by Mark Dickinson dicki...@gmail.com:
Removed file: http://bugs.python.org/file13711/issue5780.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5780
___
Eric Smith e...@trueblade.com added the comment:
Also, remove_trailing_zeros should go inside the #ifdef so it's not
included if Gay's code is being used.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5780
Eric Smith e...@trueblade.com added the comment:
I agree that there should be 2 behaviors, not 3.
This patch looks okay to me, and tests pass both with and without
defining PY_NO_SHORT_FLOAT_REPR.
One nit: You don't need to use Py_CHARMASK when using the ISDIGIT macro
locally defined in
Mark Dickinson dicki...@gmail.com added the comment:
Here's a patch. Eric, do you have time to check this over for general
sanity?
--
keywords: +patch
Added file: http://bugs.python.org/file13711/issue5780.patch
___
Python tracker
Mark Dickinson dicki...@gmail.com added the comment:
I seem to recall that despite the C standards, there are platforms around
where isdigit and isxdigit are still locale aware. This bit me when I
implemented float.fromhex: see r65964.
And my man page for isdigit says:
COMPATIBILITY
Eric Smith e...@trueblade.com added the comment:
I definitely think that if you go with isdigit, you need the macro. I've
been bitten by this in 3.0.
My actual suggestion is to go with isdigit and the macro everywhere in
this file and all files.
But for just this checkin, ISDIGIT is probably
Mark Dickinson dicki...@gmail.com added the comment:
Committed, with the fixups Eric pointed out, in r71692.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org