Mark Dickinson <[email protected]> added the comment:
A couple of notes on the patch:
- the test_unicodedata failure was a result of computing a checksum involving
str(numeric_value_of_character) for fraction characters like 1/6 and 2/3. I've
changed the test to use '{.12g}'.format(numeric_value) instead, and updated the
checksum.
- the patch changes the result of format(x, ''), so that it continues to match
str(x) when x is a float or complex instance. So when there's no typecode and
no precision given, float formatting behaves like repr/str; when there's no
typecode but a precision *is* given, float formatting behaves like 'g'
formatting, but always ensures at least one digit after the point for a result
in non-scientific format (as before).
This change involves some slightly messy logic in formatter.h (which now needs
to pass type 'r' to PyOS_double_to_string in this case); there may be a better
way to write this code. Eric, if you have a chance to look at the formatter.h
changes, I'd appreciate your comments.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue9337>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com