summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib
Commit message (Collapse)AuthorAgeFilesLines
* Issue #13417: speed up utf-8 decoding by around 2x for the non-fully-ASCII case.Antoine Pitrou2011-11-211-0/+156
| | | | | This almost catches up with pre-PEP 393 performance, when decoding needed only one pass.
* stringlib: remove unused STRINGLIB_FILLVictor Stinner2011-11-206-6/+0
|
* Replace PyUnicodeObject type by PyObjectVictor Stinner2011-11-031-12/+8
| | | | | * _PyUnicode_CheckConsistency() now takes a PyObject* instead of void* * Remove now useless casts to PyObject*
* Replace PyUnicodeObject* by PyObject* where it was irrevelantVictor Stinner2011-10-231-4/+4
| | | | | | A Unicode string can now be a PyASCIIObject, PyCompactUnicodeObject or PyUnicodeObject. Aliasing a PyASCIIObject* or PyCompactUnicodeObject* to PyUnicodeObject* is wrong
* Issue #12170: The count(), find(), rfind(), index() and rindex() methodsAntoine Pitrou2011-10-201-0/+43
| | | | | of bytes and bytearray objects now accept an integer between 0 and 255 as their first argument. Patch by Petri Lehtinen.
* Fix typoAntoine Pitrou2011-10-171-1/+1
|
* Add a comment explaining this heuristic.Antoine Pitrou2011-10-131-0/+3
|
* Simplify heuristic for when to use memchrAntoine Pitrou2011-10-131-11/+1
|
* Issue #13155: Optimize finding the optimal character width of an unicode stringAntoine Pitrou2011-10-121-0/+136
|
* stringlib: Fix STRINGLIB_STR for UCS2/UCS4Victor Stinner2011-10-112-2/+2
|
* Fix fastsearch for UCS2 and UCS4Victor Stinner2011-10-118-2/+15
| | | | | * If needle is 0, try (p[0] >> 16) & 0xff for UCS4 * Disable fastsearch_memchr_1char() if needle is zero for UCS2 and UCS4
* Issue #13134: optimize finding single-character strings using memchrAntoine Pitrou2011-10-111-0/+73
|
* Change PyUnicode_KIND to 1,2,4. Drop _KIND_SIZE and _CHARACTER_SIZE.Martin v. Löwis2011-10-071-1/+1
|
* Fix massive slowdown in string formatting with str.format.Antoine Pitrou2011-10-071-128/+24
| | | | | | | | | | Example: ./python -m timeit -s "f='{}' + '-' * 1024 + '{}'; s='abcd' * 16384" "f.format(s, s)" -> before: 547 usec per loop -> after: 13 usec per loop -> 3.2: 22.5 usec per loop -> 2.7: 12.6 usec per loop
* Fix compilation warnings under 64-bit WindowsAntoine Pitrou2011-10-061-1/+1
|
* Add asciilib: similar to ucs1, ucs2 and ucs4 library, but specialized to ASCIIVictor Stinner2011-10-051-0/+34
| | | | | | 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.
* Mark PyUnicode_FromUCS[124] as privateVictor Stinner2011-09-283-3/+3
|
* Implement PEP 393.Martin v. Löwis2011-09-2815-1764/+386
|
* Issue #1621: Fix undefined behaviour from signed overflow in datetime module ↵Mark Dickinson2011-09-251-8/+6
| | | | hashes, array and list iterations, and get_integer (stringlib/string_format.h)
* Issue #1621: Fix undefined behaviour from signed overflow in get_integer ↵Mark Dickinson2011-09-241-9/+7
| | | | (stringlib/formatter.h)
* Closes #12579. Positional fields with str.format_map() now raise a ↵Eric V. Smith2011-07-181-0/+10
| | | | ValueError instead of SystemError.
* MERGE: startswith and endswith don't accept None as slice index. Patch by ↵Jesus Cea2011-04-201-19/+48
|\ | | | | | | Torsten Becker. (closes #11828)
| * startswith and endswith don't accept None as slice index. Patch by Torsten ↵Jesus Cea2011-04-201-19/+48
| | | | | | | | Becker. (closes #11828)
* | #11515: Merge with 3.1.Ezio Melotti2011-03-151-1/+1
|\ \ | |/
| * #11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-151-1/+1
| |
| * 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. ........
| * Merged revisions 81823,81835 via svnmerge fromBenjamin Peterson2010-06-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81823 | benjamin.peterson | 2010-06-07 17:31:26 -0500 (Mon, 07 Jun 2010) | 9 lines Merged revisions 81820 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81820 | benjamin.peterson | 2010-06-07 17:23:23 -0500 (Mon, 07 Jun 2010) | 1 line correctly overflow when indexes are too large ........ ................ r81835 | benjamin.peterson | 2010-06-08 09:57:22 -0500 (Tue, 08 Jun 2010) | 9 lines Merged revisions 81834 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81834 | benjamin.peterson | 2010-06-08 09:53:29 -0500 (Tue, 08 Jun 2010) | 1 line kill extra word ........ ................
| * Recorded merge of revisions 81032 via svnmerge fromAntoine Pitrou2010-05-094-163/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines Recorded merge of revisions 81029 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........ ................
| * Merged revisions 78350 via svnmerge fromEric Smith2010-02-231-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78350 | eric.smith | 2010-02-22 19:22:24 -0500 (Mon, 22 Feb 2010) | 9 lines Merged revisions 78349 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78349 | eric.smith | 2010-02-22 19:11:16 -0500 (Mon, 22 Feb 2010) | 1 line Issue #6902: Fix problem with built-in types format incorrectly with 0 padding. ........ ................
| * Merged revisions 78333 via svnmerge fromEric Smith2010-02-221-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78333 | eric.smith | 2010-02-22 13:54:44 -0500 (Mon, 22 Feb 2010) | 9 lines Merged revisions 78329 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78329 | eric.smith | 2010-02-22 13:33:47 -0500 (Mon, 22 Feb 2010) | 1 line Issue #7988: Fix default alignment to be right aligned for complex.__format__. Now it matches other numeric types. ........ ................
| * Merged revisions 77937 via svnmerge fromBenjamin Peterson2010-02-031-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77937 | benjamin.peterson | 2010-02-02 20:35:45 -0600 (Tue, 02 Feb 2010) | 75 lines Merged revisions 77484,77487,77561,77570,77593,77603,77608,77667,77702-77703,77739,77858,77887,77889 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77484 | skip.montanaro | 2010-01-13 19:12:34 -0600 (Wed, 13 Jan 2010) | 4 lines Update PyEval_EvalFrame to PyEval_EvalFrameEx. This looks to have been done partially before. Also add a comment describing how this might have to work with different versions of the interpreter. ........ r77487 | ezio.melotti | 2010-01-14 05:34:10 -0600 (Thu, 14 Jan 2010) | 1 line Fixed typo ........ r77561 | georg.brandl | 2010-01-17 02:42:30 -0600 (Sun, 17 Jan 2010) | 1 line #7699: improve datetime docs: straightforward linking to strftime/strptime section, mark classmethods as such. ........ r77570 | georg.brandl | 2010-01-17 06:14:42 -0600 (Sun, 17 Jan 2010) | 1 line Add note about usage of STRINGLIB_EMPTY. ........ r77593 | georg.brandl | 2010-01-17 17:33:53 -0600 (Sun, 17 Jan 2010) | 1 line Fix internal reference. ........ r77603 | benjamin.peterson | 2010-01-18 17:07:56 -0600 (Mon, 18 Jan 2010) | 8 lines data descriptors do not override the class dictionary if __get__ is not defined Adjust documentation and add a test to verify this behavior. See http://mail.python.org/pipermail/python-dev/2010-January/095637.html for discussion. ........ r77608 | gregory.p.smith | 2010-01-19 02:19:03 -0600 (Tue, 19 Jan 2010) | 6 lines Do not compile stubs for the sha2 series hashes in the openssl hashlib module when the openssl version is too old to support them. That leads both compiled code bloat and to unittests attempting to test implementations that don't exist for comparison purposes on such platforms. ........ r77667 | mark.dickinson | 2010-01-21 12:32:27 -0600 (Thu, 21 Jan 2010) | 1 line Add two more test_strtod test values. ........ r77702 | georg.brandl | 2010-01-23 02:43:31 -0600 (Sat, 23 Jan 2010) | 1 line #7762: fix refcount annotation of PyUnicode_Tailmatch(). ........ r77703 | georg.brandl | 2010-01-23 02:47:54 -0600 (Sat, 23 Jan 2010) | 1 line #7725: fix referencing issue. ........ r77739 | benjamin.peterson | 2010-01-24 21:52:52 -0600 (Sun, 24 Jan 2010) | 1 line mention from_float() in error message ........ r77858 | georg.brandl | 2010-01-30 11:57:48 -0600 (Sat, 30 Jan 2010) | 1 line #7802: fix invalid example (heh). ........ r77887 | georg.brandl | 2010-01-31 12:51:49 -0600 (Sun, 31 Jan 2010) | 5 lines Fix-up ftplib documentation: move exception descriptions to toplevel, not inside a class remove attribution in "versionadded" spell and grammar check docstring of FTP_TLS ........ r77889 | michael.foord | 2010-01-31 13:59:26 -0600 (Sun, 31 Jan 2010) | 1 line Minor modification to unittest documentation. ........ ................
| * Merged revisions 74222 via svnmerge fromEric Smith2009-07-271-9/+16
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r74222 | eric.smith | 2009-07-26 22:10:42 -0400 (Sun, 26 Jul 2009) | 1 line Sync trunk and py3k versions of string formatting. Manual merge of r74219. ........
* | Issue #11302: missing type check on _string.formatter_field_name_split and ↵Eric Smith2011-01-291-0/+10
| | | | | | | | | | | | _string.formatter_parser caused crash. Originial patch by haypo, reviewed by me, okayed by Georg.
* | Issue #7094: Add alternate ('#') flag to __format__ methods for float, ↵Eric Smith2010-11-251-16/+6
| | | | | | | | complex and Decimal. Allows greater control over when decimal points appear. Added to make transitioning from %-formatting easier. '#g' still has a problem with Decimal which I'll fix soon.
* | Followup to r86170: fix reference leak in str.formatAntoine Pitrou2010-11-051-1/+0
| |
* | Issue #6081: Add str.format_map. str.format_map(mapping) is similar to ↵Eric Smith2010-11-041-1/+10
| | | | | | | | str.format(**mapping), except mapping does not get converted to a dict.
* | #9418: first step of moving private string methods to _string module.Georg Brandl2010-10-141-2/+2
| |
* | Fix #8530: Prevent stringlib fastsearch from reading beyond the front of an ↵Florent Xicluna2010-08-081-2/+2
| | | | | | | | array.
* | Issue #9337: Make float.__str__ identical to float.__repr__.Mark Dickinson2010-08-041-6/+11
| | | | | | | | (And similarly for complex numbers.)
* | Issue #9416: Fix some issues with complex formatting where theMark Dickinson2010-08-011-4/+8
| | | | | | | | | | | | | | 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 unneeded error checkBenjamin Peterson2010-07-111-8/+0
| |
* | Merged revisions 81824 via svnmerge fromBenjamin Peterson2010-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81824 | benjamin.peterson | 2010-06-07 17:32:44 -0500 (Mon, 07 Jun 2010) | 1 line remove extra byte and fix comment ........
* | Merged revisions 81820 via svnmerge fromBenjamin Peterson2010-06-071-0/+4
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81820 | benjamin.peterson | 2010-06-07 17:23:23 -0500 (Mon, 07 Jun 2010) | 1 line correctly overflow when indexes are too large ........
* | Merged revisions 81813 via svnmerge fromBenjamin Peterson2010-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81813 | benjamin.peterson | 2010-06-07 16:37:09 -0500 (Mon, 07 Jun 2010) | 2 lines locale grouping strings should end in '\0' ........
* | Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-092-98/+98
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* | Merged revisions 78349 via svnmerge fromEric Smith2010-02-231-4/+7
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78349 | eric.smith | 2010-02-22 19:11:16 -0500 (Mon, 22 Feb 2010) | 1 line Issue #6902: Fix problem with built-in types format incorrectly with 0 padding. ........
* | Merged revisions 78329 via svnmerge fromEric Smith2010-02-221-10/+40
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78329 | eric.smith | 2010-02-22 13:33:47 -0500 (Mon, 22 Feb 2010) | 1 line Issue #7988: Fix default alignment to be right aligned for complex.__format__. Now it matches other numeric types. ........
* | Merged revisions ↵Benjamin Peterson2010-02-031-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 77484,77487,77561,77570,77593,77603,77608,77667,77702-77703,77739,77858,77887,77889 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77484 | skip.montanaro | 2010-01-13 19:12:34 -0600 (Wed, 13 Jan 2010) | 4 lines Update PyEval_EvalFrame to PyEval_EvalFrameEx. This looks to have been done partially before. Also add a comment describing how this might have to work with different versions of the interpreter. ........ r77487 | ezio.melotti | 2010-01-14 05:34:10 -0600 (Thu, 14 Jan 2010) | 1 line Fixed typo ........ r77561 | georg.brandl | 2010-01-17 02:42:30 -0600 (Sun, 17 Jan 2010) | 1 line #7699: improve datetime docs: straightforward linking to strftime/strptime section, mark classmethods as such. ........ r77570 | georg.brandl | 2010-01-17 06:14:42 -0600 (Sun, 17 Jan 2010) | 1 line Add note about usage of STRINGLIB_EMPTY. ........ r77593 | georg.brandl | 2010-01-17 17:33:53 -0600 (Sun, 17 Jan 2010) | 1 line Fix internal reference. ........ r77603 | benjamin.peterson | 2010-01-18 17:07:56 -0600 (Mon, 18 Jan 2010) | 8 lines data descriptors do not override the class dictionary if __get__ is not defined Adjust documentation and add a test to verify this behavior. See http://mail.python.org/pipermail/python-dev/2010-January/095637.html for discussion. ........ r77608 | gregory.p.smith | 2010-01-19 02:19:03 -0600 (Tue, 19 Jan 2010) | 6 lines Do not compile stubs for the sha2 series hashes in the openssl hashlib module when the openssl version is too old to support them. That leads both compiled code bloat and to unittests attempting to test implementations that don't exist for comparison purposes on such platforms. ........ r77667 | mark.dickinson | 2010-01-21 12:32:27 -0600 (Thu, 21 Jan 2010) | 1 line Add two more test_strtod test values. ........ r77702 | georg.brandl | 2010-01-23 02:43:31 -0600 (Sat, 23 Jan 2010) | 1 line #7762: fix refcount annotation of PyUnicode_Tailmatch(). ........ r77703 | georg.brandl | 2010-01-23 02:47:54 -0600 (Sat, 23 Jan 2010) | 1 line #7725: fix referencing issue. ........ r77739 | benjamin.peterson | 2010-01-24 21:52:52 -0600 (Sun, 24 Jan 2010) | 1 line mention from_float() in error message ........ r77858 | georg.brandl | 2010-01-30 11:57:48 -0600 (Sat, 30 Jan 2010) | 1 line #7802: fix invalid example (heh). ........ r77887 | georg.brandl | 2010-01-31 12:51:49 -0600 (Sun, 31 Jan 2010) | 5 lines Fix-up ftplib documentation: move exception descriptions to toplevel, not inside a class remove attribution in "versionadded" spell and grammar check docstring of FTP_TLS ........ r77889 | michael.foord | 2010-01-31 13:59:26 -0600 (Sun, 31 Jan 2010) | 1 line Minor modification to unittest documentation. ........
* | Merged revisions 77469-77470 via svnmerge fromAntoine Pitrou2010-01-131-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77469 | antoine.pitrou | 2010-01-13 14:43:37 +0100 (mer., 13 janv. 2010) | 3 lines Test commit to try to diagnose failures of the IA-64 buildbot ........ r77470 | antoine.pitrou | 2010-01-13 15:01:26 +0100 (mer., 13 janv. 2010) | 3 lines Sanitize bloom filter macros ........
* | svnmerge duplicated contents of Objects/stringlib/split.hAntoine Pitrou2010-01-131-394/+0
| |