Eric Smith <e...@trueblade.com> added the comment: My changes on the py3k-short-float-repr branch include:
- Create a new function PyOS_double_to_string. This will replace PyOS_ascii_formatd. All existing internal uses of PyOS_ascii_formatd follow this pattern: printf into a buffer to build up the format string, call PyOS_ascii_formatd, then parse the format string to determine what to do. The changes to the API are: - discrete parameters instead of a printf-like format string. No parsing is required. - returns PyMem_Malloc'd memory instead of writing into a supplied buffer. - Modify all callers of PyOS_ascii_formatd to call PyOS_double_to_string instead. These are: - Modules/_pickle.c - Objects/complexobject.c - Objects/floatobject.c - Objects/stringlib/formatter.h - Objects/unicodeobject.c - Python/marshal.c Remaining to be done: - Re-enable 'n' (locale-aware) formatting in float.__format__(). - Decide what to do about the change in meaning of "alt" formatting with format code 'g' when an exponent is present, also in float.__format__(). - Have marshal.c deal with potential memory failures returned from PyOS_double_to_string. - Deprecate PyOS_ascii_formatd. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1580> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com