Stefan Krah
f432a3234f
bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. ( #3157 )
8 years ago
Benjamin Peterson
59e5e0dca2
improve type-safe of and prevent double-frees in get_locale_info ( #28119 )
9 years ago
Benjamin Peterson
eb0dfa9251
make invalid_comma_and_underscore a real prototype
9 years ago
Eric V. Smith
89e1b1aae0
Issue 27080: PEP 515: add '_' formatting option.
9 years ago
Martin Panter
0be894b2f6
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
9 years ago
Raymond Hettinger
15f44ab043
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
9 years ago
Serhiy Storchaka
1f9326196e
Issue #27818 : Speed up parsing width and precision in format() strings for
numbers. Patch by Stefan Behnel.
9 years ago
Martin Panter
4c35964b76
Corrections for a/an in code comments and documentation
10 years ago
Serhiy Storchaka
2d06e84455
Issue #25923 : Added the const qualifier to static constant arrays.
10 years ago
Eric V. Smith
a12572ff3a
Close issue #8931 : Make alternate formatting for 'c' raise an exception. Patch by Torsten Landschoff.
12 years ago
Vinay Sajip
809f90f369
Reverted 16efa8d27e4c after discussion with Eric.
12 years ago
Eric V. Smith
a0d107324d
Closed issue #8931 : Make alternate formatting for 'c' raise an exception. Patch by Torsten Landschoff.
12 years ago
Eric V. Smith
2ea9712ee9
Issue #12546 : Allow \x00 as a fill character for builtin type __format__ methods.
12 years ago
Victor Stinner
4a58707a34
Add _PyUnicodeWriter_WriteASCIIString() function
12 years ago
Serhiy Storchaka
9594942716
Issue #18783 : Removed existing mentions of Python long type in docstrings,
error messages and comments.
13 years ago
Victor Stinner
76d38502e4
Issue #9566 : Fix a compiler warning on Windows x64
13 years ago
Victor Stinner
2f084ecfe7
Issue #18137 : Detect integer overflow on precision in float.__format__() and
complex.__format__().
13 years ago
Victor Stinner
9ce59bbe43
Fix a compilater warning on Windows 64-bit
13 years ago
Victor Stinner
22c103b3cc
Fix a compiler warning: use unsigned int type instead of enum PyUnicode_Kind to
compare two Unicode kinds
13 years ago
Victor Stinner
eb4b5ac8af
Close #16757 : Avoid calling the expensive _PyUnicode_FindMaxChar() function
when possible
13 years ago
Victor Stinner
621ef3d84f
Issue #15609 : Optimize str%args for integer argument
- Use _PyLong_FormatWriter() instead of formatlong() when possible, to avoid
a temporary buffer
- Enable the fast path when width is smaller or equals to the length,
and when the precision is bigger or equals to the length
- Add unit tests!
- formatlong() uses PyUnicode_Resize() instead of _PyUnicode_FromASCII()
to resize the output string
13 years ago
Stefan Krah
d9c1bf7f1f
After the jump in line 1051 unicode_tmp is NULL. Found by Coverity.
13 years ago
Victor Stinner
2d6266d5f1
Remove now unused IntOrLongToString type
14 years ago
Brett Cannon
8a250fac15
Comment out a dead increment.
Found by Clang's static analyzer.
14 years ago
doko@ubuntu.com
39378f7f4f
format_obj: make it static
14 years ago
Victor Stinner
c9d369f1bf
Optimize _PyUnicode_FastCopyCharacters() when maxchar(from) > maxchar(to)
14 years ago
Victor Stinner
d3f0882dfb
Issue #14744 : Use the new _PyUnicodeWriter internal API to speed up str%args 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.
14 years ago
Victor Stinner
ece58deb9f
Close #14648 : Compute correctly maxchar in str.format() for substrin
14 years ago
Benjamin Peterson
80d07f8251
inherit maxchar of field value where needed ( closes #14648 )
14 years ago
Victor Stinner
90f50d4df9
Issue #13706 : Fix format(float, "n") for locale with non-ASCII decimal point (e.g. ps_aF)
14 years ago
Victor Stinner
41a863cb81
Issue #13706 : Fix format(int, "n") for locale with non-ASCII thousands separator
* 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
14 years ago
Victor Stinner
ed27785b32
Issue #13706 : Add assertions to detect bugs earlier
14 years ago
Amaury Forgeot d'Arc
6d766fc3fa
Silence last compilation warning.
14 years ago
Amaury Forgeot d'Arc
cd27df3a99
Fix compilation warnings (seen on win32 buildbot)
14 years ago
Victor Stinner
a4ac600d6f
Issue #13706 : Support non-ASCII fill characters
14 years ago
Eric V. Smith
d25cfe66f5
Improve exception text. Closes issue 13811.
14 years ago
Benjamin Peterson
21e0da228d
remove some usage of Py_UNICODE_TOUPPER/LOWER
14 years ago
Victor Stinner
3fe553160c
Add a new PyUnicode_Fill() function
It is faster than the unicode_fill() function which was implemented in
formatter_unicode.c.
14 years ago
Mark Dickinson
47862d4c0e
Issue #9530 : Fix undefined behaviour due to signed overflow in Python/formatter_unicode.c.
14 years ago
Victor Stinner
c4f281eba3
Fix misuse of PyUnicode_GET_SIZE, use PyUnicode_GET_LENGTH instead
14 years ago
Martin v. Löwis
c47adb04b3
Change PyUnicode_KIND to 1,2,4. Drop _KIND_SIZE and _CHARACTER_SIZE.
14 years ago
Victor Stinner
fb9ea8c57e
Don't check for the maximum character when copying from unicodeobject.c
* 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
14 years ago
Victor Stinner
c3cec7868b
Add asciilib: similar to ucs1, ucs2 and ucs4 library, but specialized to ASCII
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.
14 years ago
Victor Stinner
fd85c3aa8d
fill_number() and format_string_internal() check for PyUnicode_CopyCharacters() failure
14 years ago
Victor Stinner
dba2deeca2
fill_number() ensures that the 'digits' string is ready
14 years ago
Victor Stinner
afbaa20fb9
fill_char() can now propagate an error
14 years ago
Martin v. Löwis
d63a3b8beb
Implement PEP 393.
14 years ago
Mark Dickinson
b42dab5452
Merged revisions 75441 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r75441 | mark.dickinson | 2009-10-15 20:55:18 +0100 (Thu, 15 Oct 2009) | 9 lines
Merged revisions 75440 via svnmerge from
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.
........
................
16 years ago
Mark Dickinson
01458c7a62
Remove the uses of WITHOUT_COMPLEX introduced in r75471
16 years ago
Mark Dickinson
42e30556e5
Merged revisions 75440 via svnmerge from
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.
........
16 years ago