8000 GH-99183: Document behavior of count() for empty substrings (GH-99339) · python/cpython@2f4af2d · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f4af2d

Browse files
authored
GH-99183: Document behavior of count() for empty substrings (GH-99339)
1 parent dbf8613 commit 2f4af2d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Doc/library/stdtypes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,9 @@ expression support in the :mod:`re` module).
16171617
range [*start*, *end*]. Optional arguments *start* and *end* are
16181618
interpreted as in slice notation.
16191619

1620+
If *sub* is empty, returns the number of empty strings between characters
1621+
which is the length of the string plus one.
1622+
16201623

16211624
.. method:: str.encode(encoding="utf-8", errors="strict")
16221625

@@ -2698,6 +2701,9 @@ arbitrary binary data.
26982701
The subsequence to search for may be any :term:`bytes-like object` or an
26992702
integer in the range 0 to 255.
27002703

2704+
If *sub* is empty, returns the number of empty slices between characters
2705+
which is the length of the bytes object plus one.
2706+
27012707
.. versionchanged:: 3.3
27022708
Also accept an integer in the range 0 to 255 as the subsequence.
27032709

0 commit comments

Comments
 (0)
0