summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
AgeCommit message (Collapse)AuthorLines
2013-08-27Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka-2/+1
error messages and comments.
2013-06-23Issue #18137: Detect integer overflow on precision in float.__format__() andVictor Stinner-2/+14
complex.__format__().
2013-02-09Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.) ↵Antoine Pitrou-1/+1
in the interpreter. I've left a couple of them in: zlib (third-party lib), getaddrinfo.c (doesn't include Python.h, and probably obsolete), _sre.c (legitimate use for the re.LOCALE flag), mpdecimal (needs to build without Python.h).
2012-09-06After the jump in line 1051 unicode_tmp is NULL. Found by Coverity.Stefan Krah-1/+1
2012-08-09Remove now unused IntOrLongToString typeVictor Stinner-3/+0
2012-06-25Comment out a dead increment.Brett Cannon-1/+1
Found by Clang's static analyzer.
2012-06-21format_obj: make it staticdoko@ubuntu.com-1/+1
2012-06-16Optimize _PyUnicode_FastCopyCharacters() when maxchar(from) > maxchar(to)Victor Stinner-2/+4
2012-05-29Issue #14744: Use the new _PyUnicodeWriter internal API to speed up str%args ↵Victor Stinner-194/+218
and str.format(args) * Formatting string, int, float and complex use the _PyUnicodeWriter API. It avoids a temporary buffer in most cases. * Add _PyUnicodeWriter_WriteStr() to restore the PyAccu optimization: just keep a reference to the string if the output is only composed of one string * Disable overallocation when formatting the last argument of str%args and str.format(args) * Overallocation allocates at least 100 characters: add min_length attribute to the _PyUnicodeWriter structure * Add new private functions: _PyUnicode_FastCopyCharacters(), _PyUnicode_FastFill() and _PyUnicode_FromASCII() The speed up is around 20% in average.
2012-04-23Close #14648: Compute correctly maxchar in str.format() for substrinVictor Stinner-4/+2
2012-04-23inherit maxchar of field value where needed (closes #14648)Benjamin Peterson-0/+3
2012-02-24Issue #13706: Fix format(float, "n") for locale with non-ASCII decimal point ↵Victor Stinner-9/+6
(e.g. ps_aF)
2012-02-24Issue #13706: Fix format(int, "n") for locale with non-ASCII thousands separatorVictor Stinner-53/+89
* Decode thousands separator and decimal point using PyUnicode_DecodeLocale() (from the locale encoding), instead of decoding them implicitly from latin1 * Remove _PyUnicode_InsertThousandsGroupingLocale(), it was not used * Change _PyUnicode_InsertThousandsGrouping() API to return the maximum character if unicode is NULL * Replace MIN/MAX macros by Py_MIN/Py_MAX * stringlib/undef.h undefines STRINGLIB_IS_UNICODE * stringlib/localeutil.h only supports Unicode
2012-02-01Issue #13706: Add assertions to detect bugs earlierVictor Stinner-3/+9
2012-01-23Silence last compilation warning.Amaury Forgeot d'Arc-1/+1
2012-01-23Fix compilation warnings (seen on win32 buildbot)Amaury Forgeot d'Arc-4/+4
2012-01-21Issue #13706: Support non-ASCII fill charactersVictor Stinner-15/+19
2012-01-19Improve exception text. Closes issue 13811.Eric V. Smith-2/+2
2012-01-11remove some usage of Py_UNICODE_TOUPPER/LOWERBenjamin Peterson-11/+16
2012-01-04Add a new PyUnicode_Fill() functionVictor Stinner-15/+6
It is faster than the unicode_fill() function which was implemented in formatter_unicode.c.
2011-12-01Issue #9530: Fix undefined behaviour due to signed overflow in ↵Mark Dickinson-9/+7
Python/formatter_unicode.c.
2011-10-11Fix misuse of PyUnicode_GET_SIZE, use PyUnicode_GET_LENGTH insteadVictor Stinner-1/+1
2011-10-07Change PyUnicode_KIND to 1,2,4. Drop _KIND_SIZE and _CHARACTER_SIZE.Martin v. Löwis-2/+2
2011-10-06Don't check for the maximum character when copying from unicodeobject.cVictor Stinner-9/+7
* Create copy_characters() function which doesn't check for the maximum character in release mode * _PyUnicode_CheckConsistency() is no more static to be able to use it in _PyUnicode_FormatAdvanced() (in formatter_unicode.c) * _PyUnicode_CheckConsistency() checks the string hash
2011-10-05Add asciilib: similar to ucs1, ucs2 and ucs4 library, but specialized to ASCIIVictor Stinner-2/+2
ucs1, ucs2 and ucs4 libraries have to scan created substring to find the maximum character, whereas it is not need to ASCII strings. Because ASCII strings are common, it is useful to optimize ASCII.
2011-09-28fill_number() and format_string_internal() check for ↵Victor Stinner-3/+8
PyUnicode_CopyCharacters() failure
2011-09-28fill_number() ensures that the 'digits' string is readyVictor Stinner-1/+4
2011-09-28fill_char() can now propagate an errorVictor Stinner-25/+47
2011-09-28Implement PEP 393.Martin v. Löwis-6/+1439
2009-10-18Remove the uses of WITHOUT_COMPLEX introduced in r75471Mark Dickinson-2/+0
2009-10-15Merged revisions 75440 via svnmerge fromMark Dickinson-0/+2
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75440 | mark.dickinson | 2009-10-15 18:45:39 +0100 (Thu, 15 Oct 2009) | 1 line Allow core Python build to succeed under WITHOUT_COMPLEX. The module build stage still fails. ........
2009-04-30Issue #1588: Add complex.__format__.Eric Smith-3/+4
2008-05-30Refactor and clean up str.format() code (and helpers) in advance of ↵Eric Smith-5/+5
optimizations.
2007-08-25Implementation of PEP 3101, Advanced String Formatting.Eric Smith-0/+13
Known issues: The string.Formatter class, as discussed in the PEP, is incomplete. Error handling needs to conform to the PEP. Need to fix this warning that I introduced in Python/formatter_unicode.c: Objects/stringlib/unicodedefs.h:26: warning: `STRINGLIB_CMP' defined but not used Need to make sure sign formatting is correct, more tests needed. Need to remove '()' sign formatting, left over from an earlier version of the PEP.