aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40521: Make empty Unicode string per interpreter (GH-21096)Victor Stinner2020-06-241-1/+0
| | | Each interpreter now has its own empty Unicode string singleton.
* bpo-40521: Make bytes singletons per interpreter (GH-21074)Victor Stinner2020-06-231-1/+1
| | | | | | Each interpreter now has its own empty bytes string and single byte character singletons. Replace STRINGLIB_EMPTY macro with STRINGLIB_GET_EMPTY() macro.
* Issue #18701: Remove support of old CPython versions (<3.0) from C code.Serhiy Storchaka2013-08-171-5/+0
|
* stringlib: remove unused STRINGLIB_RESIZE macroVictor Stinner2013-04-141-1/+0
|
* Issue #13706: Fix format(int, "n") for locale with non-ASCII thousands separatorVictor Stinner2012-02-241-2/+0
| | | | | | | | | | | * 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
* remove some usage of Py_UNICODE_TOUPPER/LOWERBenjamin Peterson2012-01-111-2/+0
|
* stringlib: remove unused STRINGLIB_FILLVictor Stinner2011-11-201-1/+0
|
* Fix fastsearch for UCS2 and UCS4Victor Stinner2011-10-111-0/+1
| | | | | * If needle is 0, try (p[0] >> 16) & 0xff for UCS4 * Disable fastsearch_memchr_1char() if needle is zero for UCS2 and UCS4
* Implement PEP 393.Martin v. Löwis2011-09-281-0/+2
|
* Merged revisions 77461 via svnmerge fromAntoine Pitrou2010-01-131-0/+2
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77461 | antoine.pitrou | 2010-01-13 08:55:48 +0100 (mer., 13 janv. 2010) | 5 lines Issue #7622: Improve the split(), rsplit(), splitlines() and replace() methods of bytes, bytearray and unicode objects by using a common implementation based on stringlib's fast search. Patch by Florent Xicluna. ........
* Merged revisions 77241 via svnmerge fromAntoine Pitrou2010-01-021-19/+0
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77241 | antoine.pitrou | 2010-01-02 22:12:58 +0100 (sam., 02 janv. 2010) | 4 lines Issue #7462: Implement the stringlib fast search algorithm for the `rfind`, `rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna. ........
* Issue #5748: bytesobject.c should not have its own private defines for ↵Eric Smith2009-11-301-0/+1
| | | | stringlib macros. Also removed unused defines and include for localutil.h.
* Added ',' thousands grouping to int.__format__. See PEP 378.Eric Smith2009-04-031-0/+1
| | | | | | | | | This is incomplete, but I want to get some version into the next alpha. I am still working on: Documentation. More tests. Implement for floats. In addition, there's an existing bug with 'n' formatting that carries forward to thousands grouping (issue 5515).
* #2630: Implement PEP 3138.Georg Brandl2008-06-111-0/+2
| | | | | | | The repr() of a string now contains printable Unicode characters unescaped. The new ascii() builtin can be used to get a repr() with only ASCII characters in it. PEP and patch were written by Atsuo Ishimoto.
* Merged revisions 63078 via svnmerge fromEric Smith2008-05-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk When forward porting this, I added _PyUnicode_InsertThousandsGrouping. ........ r63078 | eric.smith | 2008-05-11 15:52:48 -0400 (Sun, 11 May 2008) | 14 lines Addresses issue 2802: 'n' formatting for integers. 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. ........
* Fixes for shared 2.6 code that implements PEP 3101, advanced stringEric Smith2008-02-171-0/+6
| | | | | | | | | | | | | | | | | formatting. Includes: - Modifying tests for basic types to use __format__ methods, instead of builtin "format". - Adding PyObject_Format. - General str/unicode cleanup discovered when backporting to 2.6. - Removing datetimemodule.c's time_format, since it was identical to date_format. 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).
* Replace PyObject_Unicode with PyObject_Str everywhere, and remove theThomas Heller2007-11-151-1/+1
| | | | #define for PyObject_Unicode in object.h.
* For PEP3137: Adds missing methods to the mutable PyBytes object (soonGregory P. Smith2007-10-161-0/+2
| | | | | | | | to be called a buffer). Shares code with stringobject when possible. Adds unit tests with common code that should be usable to test the PEPs mutable buffer() and immutable bytes() types. http://bugs.python.org/issue1261
* Changed to use 'U' argument to PyArg_ParseTuple, instead of manually ↵Eric Smith2007-09-011-0/+1
| | | | checking for unicode objects.
* Changed STRINGLIB_CMP from an inline function to a macro in order to avoid a ↵Eric Smith2007-08-281-0/+11
| | | | 'defined but not used' warning.
* Implementation of PEP 3101, Advanced String Formatting.Eric Smith2007-08-251-0/+32
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.