| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
(GH-110170) (#110182)
gh-110160: Fix flaky `test_find_periodic_pattern` in `string_tests` (GH-110170)
(cherry picked from commit 06faa9a39bd93c5e7999d52b52043ecdd0774dac)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Implement an enhanced variant of Crochemore and Perrin's Two-Way string searching algorithm, which reduces worst-case time from quadratic (the product of the string and pattern lengths) to linear. This applies to forward searches (like``find``, ``index``, ``replace``); the algorithm for reverse searches (like ``rfind``) is not changed.
Co-authored-by: Tim Peters <tim.peters@gmail.com>
|
|
|
|
|
| |
Added str.removeprefix and str.removesuffix methods and corresponding
bytes, bytearray, and collections.UserString methods to remove affixes
from a string if present. See PEP 616 for a full description.
|
| |
|
|
|
|
|
|
|
| |
The final addition (cur += step) may overflow, so use size_t for "cur".
"cur" is always positive (even for negative steps), so it is safe to use
size_t here.
Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
|
|
|
|
| |
uppercasing it (GH-12804)
|
| |
|
| |
|
|
|
|
| |
Remove redundant tests now that str is unicode.
|
|
|
|
| |
This eliminates a few redundant test cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ByteArrayAsStringTest.fixtype() was converting test data to bytes, not byte-
array, therefore many of the test cases inherited in this class were not
actually being run on the bytearray type.
The tests in buffer_tests.py were redundant with methods in string_tests
.MixinStrUnicodeUserStringTest and string_tests.CommonTest. These methods are
now moved into string_tests.BaseTest, where they will also get run for bytes
and bytearray.
This change also moves test_additional_split(), test_additional_rsplit(), and
test_strip() from CommonTest to BaseTest, meaning these tests are now run for
bytes and bytearray. I plan to eliminate redundancies with existing tests in
test_bytes.py soon.
|
|
|
|
|
|
|
|
| |
* test_contains() did not override anything
* test_expandtabs/upper/lower() in FixedStringTest were masking usable tests
in string_tests. These tests now get run for bytearray() and bytes().
* test_expandtabs/upper/lower() in buffer_tests were only run on bytearray()
and are redundant with string_tests
|
| |
|
|
|
|
|
| |
return True when finding the empty string and the indexes are completely out
of range.
|
|\ |
|
| |
| |
| |
| | |
Patch by Yongzhi Pan.
|
|/ |
|
|\ |
|
| | |
|
| |
| |
| |
| | |
and %x (introduced in issue #19995).
|
|\ \
| |/ |
|
| | |
|
|/ |
|
| |
|
|\
| |
| |
| |
| |
| | |
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
|
| |
| |
| |
| |
| |
| | |
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
|
| |
| |
| |
| | |
test discovery. Patch by Zachary Ware.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| | |
(_s => s)
Replace _s with ptr to avoid future confusion. Add also non regression tests.
|
| |
| |
| |
| | |
checks in old-style string formatting. Thanks Serhiy Storchaka for report and original patch.
|
| |
| |
| |
| | |
bytearray.split may now be passed as keyword arguments.
|
| |
| |
| |
| | |
Also broaden the category of characters that count as lowercase/uppercase.
|
| |
| |
| |
| |
| | |
of bytes and bytearray objects now accept an integer between 0 and 255
as their first argument. Patch by Petri Lehtinen.
|
|/
|
|
| |
str.splitlines, bytes.splitlines and bytearray.splitlines.
|
|
|
|
| |
cased non-letter characters.
|
| |
|
|\
| |
| |
| | |
Torsten Becker. (closes #11828)
|
| |
| |
| |
| | |
Becker. (closes #11828)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line
#9424: Replace deprecated assert* methods in the Python test suite.
........
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r77731 | ezio.melotti | 2010-01-24 22:59:24 +0200 (Sun, 24 Jan 2010) | 9 lines
Merged revisions 77729 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77729 | ezio.melotti | 2010-01-24 22:48:35 +0200 (Sun, 24 Jan 2010) | 1 line
remove archaic functions from test_support
........
................
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77729 | ezio.melotti | 2010-01-24 22:48:35 +0200 (Sun, 24 Jan 2010) | 1 line
remove archaic functions from test_support
........
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77249 | antoine.pitrou | 2010-01-02 22:53:44 +0100 (sam., 02 janv. 2010) | 3 lines
Remove silly conditional.
........
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77247 | antoine.pitrou | 2010-01-02 22:47:10 +0100 (sam., 02 janv. 2010) | 5 lines
Add tests for issue #7458: str.rfind() would crash when called with an invalid
start value. The offending code itself was removed as part of #7462.
This patch by Victor Stinner.
........
|