-
- Downloads
bpo-45995: add "z" format specifer to coerce negative 0 to zero (GH-30049)
Add "z" format specifier to coerce negative 0 to zero. See https://github.com/python/cpython/issues/90153 (originally https://bugs.python.org/issue45995 ) for discussion. This covers `str.format()` and f-strings. Old-style string interpolation is not supported. Co-authored-by:Mark Dickinson <dickinsm@gmail.com>
Showing
- Doc/library/string.rst 10 additions, 1 deletionDoc/library/string.rst
- Include/internal/pycore_format.h 2 additions, 0 deletionsInclude/internal/pycore_format.h
- Include/pystrtod.h 1 addition, 0 deletionsInclude/pystrtod.h
- Lib/_pydecimal.py 7 additions, 2 deletionsLib/_pydecimal.py
- Lib/pydoc_data/topics.py 10 additions, 1 deletionLib/pydoc_data/topics.py
- Lib/test/test_decimal.py 60 additions, 0 deletionsLib/test/test_decimal.py
- Lib/test/test_float.py 10 additions, 12 deletionsLib/test/test_float.py
- Lib/test/test_format.py 74 additions, 0 deletionsLib/test/test_format.py
- Lib/test/test_types.py 10 additions, 12 deletionsLib/test/test_types.py
- Misc/NEWS.d/next/Library/2021-12-14-13-15-41.bpo-45995.Am9pNL.rst 3 additions, 0 deletions...S.d/next/Library/2021-12-14-13-15-41.bpo-45995.Am9pNL.rst
- Modules/_decimal/_decimal.c 119 additions, 7 deletionsModules/_decimal/_decimal.c
- Objects/bytesobject.c 9 additions, 2 deletionsObjects/bytesobject.c
- Objects/unicodeobject.c 4 additions, 4 deletionsObjects/unicodeobject.c
- Python/ast_opt.c 1 addition, 0 deletionsPython/ast_opt.c
- Python/formatter_unicode.c 28 additions, 0 deletionsPython/formatter_unicode.c
- Python/pystrtod.c 20 additions, 2 deletionsPython/pystrtod.c
Loading
Please register or sign in to comment