Author eric.smith
Recipients alexandre.vassalotti, amaury.forgeotdarc, christian.heimes, eric.smith, gvanrossum, mark.dickinson, nascheme, noam, preston, rhettinger, tim.peters
Date 2009-04-07.09:33:07
SpamBayes Score 4.9854e-09
Marked as misclassified No
Message-id <1239096791.53.0.605705376466.issue1580@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-04-07 09:33:11eric.smithsetrecipients: + eric.smith, gvanrossum, tim.peters, nascheme, rhettinger, amaury.forgeotdarc, mark.dickinson, christian.heimes, alexandre.vassalotti, noam, preston
2009-04-07 09:33:11eric.smithsetmessageid: <1239096791.53.0.605705376466.issue1580@psf.upfronthosting.co.za>
2009-04-07 09:33:09eric.smithlinkissue1580 messages
2009-04-07 09:33:08eric.smithcreate