Message85690
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. |
|
Date |
User |
Action |
Args |
2009-04-07 09:33:11 | eric.smith | set | recipients:
+ eric.smith, gvanrossum, tim.peters, nascheme, rhettinger, amaury.forgeotdarc, mark.dickinson, christian.heimes, alexandre.vassalotti, noam, preston |
2009-04-07 09:33:11 | eric.smith | set | messageid: <1239096791.53.0.605705376466.issue1580@psf.upfronthosting.co.za> |
2009-04-07 09:33:09 | eric.smith | link | issue1580 messages |
2009-04-07 09:33:08 | eric.smith | create | |
|