summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib/formatter.h
Commit message (Collapse)AuthorAgeFilesLines
* Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
|
* Corrections for a/an in code comments and documentationMartin Panter2016-05-081-2/+2
|
* Issue #7267: format(int, 'c') now raises OverflowError when the argument is notVictor Stinner2015-11-091-0/+8
| | | | in range(0, 256).
* Issue #12546: Allow \x00 as a fill character for builtin type __format__ ↵Eric V. Smith2014-04-141-10/+8
| | | | methods.
* Issue #18137: Detect integer overflow on precision in float.__format__()Victor Stinner2013-06-231-2/+14
| | | | and complex.__format__().
* Issue #14700: Fix buggy overflow checks for large precision and width in ↵Mark Dickinson2012-10-281-9/+7
| | | | new-style and old-style formatting.
* Merged revisions 83400 via svnmerge fromMark Dickinson2010-08-011-4/+8
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83400 | mark.dickinson | 2010-08-01 11:41:49 +0100 (Sun, 01 Aug 2010) | 7 lines Issue #9416: Fix some issues with complex formatting where the output with no type specifier failed to match the str output: - format(complex(-0.0, 2.0), '-') omitted the real part from the output, - format(complex(0.0, 2.0), '-') included a sign and parentheses. ........
* remove extra byte and fix commentBenjamin Peterson2010-06-071-2/+2
|
* locale grouping strings should end in '\0'Benjamin Peterson2010-06-071-1/+1
|
* Issue #6902: Fix problem with built-in types format incorrectly with 0 padding.Eric Smith2010-02-231-4/+7
|
* Issue #7988: Fix default alignment to be right aligned for ↵Eric Smith2010-02-221-10/+40
| | | | complex.__format__. Now it matches other numeric types.
* Issue #3382: Make '%F' and float.__format__('F') convert results to upper ↵Eric Smith2009-11-291-14/+0
| | | | case. Much of the patch came from Mark Dickinson.
* Issue #7117, continued: Remove substitution of %g-style formatting forMark Dickinson2009-11-231-6/+0
| | | | | %f-style formatting, which used to occur at high precision. Float formatting should now be consistent between 2.7 and 3.1.
* Issue 6330: Fix --enable-unicode=ucs4.Eric Smith2009-07-301-3/+20
|
* Sync trunk and py3k versions of string formatting. Will manually merge into ↵Eric Smith2009-07-271-0/+6
| | | | py3k.
* Issue #5920: Changed format.__float__ and complex.__float__ to use a ↵Eric Smith2009-05-051-4/+8
| | | | precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson.
* Keep py3k and trunk code in sync.Eric Smith2009-05-021-0/+4
|
* Issue #1588: Add complex.__format__.Eric Smith2009-04-301-49/+334
|
* Fixed issue 5782: formatting with commas didn't work if no specifier type ↵Eric Smith2009-04-221-0/+1
| | | | code was given.
* Backport of some of the work in r71665 to trunk. This reworks much ofEric Smith2009-04-221-335/+476
| | | | | | | | | | | | | | | | | | | | | int, long, and float __format__(), and it keeps their implementation in sync with py3k. Also added PyOS_double_to_string. This is the "fallback" version that's also available in trunk, and should be kept in sync with that code. I'll add an issue to document PyOS_double_to_string in the C API. There are many internal cleanups. Externally visible changes include: - Implement PEP 378, Format Specifier for Thousands Separator, for floats, ints, and longs. - Issue #5515: 'n' formatting for ints, longs, and floats handles leading zero formatting poorly. - Issue #5772: For float.__format__, don't add a trailing ".0" if we're using no type code and we have an exponent.
* Fixed incorrect object passed into format_float_internal(). This was ↵Eric Smith2009-04-131-1/+1
| | | | resulting in a conversion being done twice.
* Issue #532631: Replace confusing fabs(x)/1e25 >= 1e25 testMark Dickinson2009-03-291-1/+1
| | | | with fabs(x) >= 1e50, and fix documentation.
* Issue #5247: Improve error message when unknown format codes are used when ↵Eric Smith2009-02-201-17/+31
| | | | using str.format() with str, unicode, long, int, and float arguments.
* Fix:Neal Norwitz2008-08-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | * crashes on memory allocation failure found with failmalloc * memory leaks found with valgrind * compiler warnings in opt mode which would lead to invalid memory reads * problem using wrong name in decimal module reported by pychecker Update the valgrind suppressions file with new leaks that are small/one-time leaks we don't care about (ie, they are too hard to fix). TBR=barry TESTED=./python -E -tt ./Lib/test/regrtest.py -uall (both debug and opt modes) in opt mode: valgrind -q --leak-check=yes --suppressions=Misc/valgrind-python.supp \ ./python -E -tt ./Lib/test/regrtest.py -uall,-bsddb,-compiler \ -x test_logging test_ssl test_multiprocessing valgrind -q --leak-check=yes --suppressions=Misc/valgrind-python.supp \ ./python -E -tt ./Lib/test/regrtest.py test_multiprocessing for i in `seq 1 4000` ; do LD_PRELOAD=~/local/lib/libfailmalloc.so FAILMALLOC_INTERVAL=$i \ ./python -c pass done At least some of these fixes should probably be backported to 2.5.
* Backed out r65069, pending fixing it in Windows.Eric Smith2008-07-171-6/+6
|
* Issue 3382: Make '%F' and float.__format__('F') convert results to upper case.Eric Smith2008-07-171-6/+6
|
* Renamed a parameter in calc_number_widths, for consistency with the same ↵Eric Smith2008-07-161-32/+32
| | | | parameter in fill_non_digits.
* Complete issue 3083: add alternate (#) formatting to bin, oct, hex in ↵Eric Smith2008-07-161-30/+68
| | | | str.format().
* Added '#' formatting to integers. This adds the 0b, 0o, or 0x prefix for ↵Eric Smith2008-07-151-13/+43
| | | | bin, oct, hex. There's still one failing case, and I need to finish the docs. I hope to finish those today.
* Fixed formatting with thousands separator and padding. Resolves issue 3140.Eric Smith2008-06-241-13/+13
|
* Typo in comment.Eric Smith2008-06-241-1/+1
|
* Modified interface to _Py_[String|Unicode]InsertThousandsGrouping, in ↵Eric Smith2008-06-241-4/+2
| | | | anticipation of fixing issue 3140.
* Refactor and clean up str.format() code (and helpers) in advance of ↵Eric Smith2008-05-301-69/+47
| | | | optimizations.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-1/+1
|
* Addresses issue 2802: 'n' formatting for integers.Eric Smith2008-05-111-3/+27
| | | | | | | | | | | | | | Adds 'n' as a format specifier for integers, to mirror the same specifier which is already available for floats. 'n' is the same as 'd', but inserts the current locale-specific thousands grouping. I added this as a stringlib function, but it's only used by str type, not unicode. This is because of an implementation detail in unicode.format(), which does its own str->unicode conversion. But the unicode version will be needed in 3.0, and it may be needed by other code eventually in 2.6 (maybe decimal?), so I left it as a stringlib implementation. As long as the unicode version isn't instantiated, there's no overhead for this.
* Bug #2388: Fix gcc warnings when compiling with --enable-unicode=ucs4.Martin v. Löwis2008-04-071-2/+13
|
* Issue 2264: empty float presentation type needs to have at least one digit ↵Eric Smith2008-03-171-1/+6
| | | | | | | | | past the decimal point. Added "Z" format_char to PyOS_ascii_formatd to support empty float presentation type. Renamed buf_size in PyOS_ascii_formatd to more accurately reflect it's meaning. Modified format.__float__ to use the new "Z" format as the default. Added test cases.
* Now that PyOS_ascii_formatd supports the 'n' format, simplify the float ↵Eric Smith2008-02-201-40/+15
| | | | formatting code to just call it.
* Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith2008-02-171-0/+980
Highlights: - Adding PyObject_Format. - Adding string.Format class. - Adding __format__ for str, unicode, int, long, float, datetime. - Adding builtin format. - Adding ''.format and u''.format. - str/unicode fixups for formatters. The files in Objects/stringlib that implement PEP 3101 (stringdefs.h, unicodedefs.h, formatter.h, string_format.h) are identical in trunk and py3k. Any changes from here on should be made to trunk, and changes will propogate to py3k).