This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: str.count
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: petri.lehtinen, py.user, r.david.murray
Priority: normal Keywords:

Created on 2011-05-24 02:10 by py.user, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg136713 - (view) Author: py.user (py.user) * Date: 2011-05-24 02:10
specification says
[code]
str.count(sub[, start[, end]])

    Return the number of non-overlapping occurrences of substring sub in the range [start, end]. Optional arguments start and end are interpreted as in slice notation.
[/code]

[code]
>>> ''.count('', None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: slice indices must be integers or None or have an __index__ method
>>>
[/code]
msg136718 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-05-24 03:29
For background on a similar issue, see #11828, especially msg133532.
msg147107 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-11-05 20:17
This already seems fixed on 2.7, 3.2 and 3.3:

>>> ''.find('', None)
0
History
Date User Action Args
2022-04-11 14:57:17adminsetgithub: 56372
2011-11-05 20:17:47petri.lehtinensetstatus: open -> closed
versions: - Python 3.1
nosy: + petri.lehtinen

messages: + msg147107

resolution: out of date
2011-05-28 07:48:15santoso.wijayasetcomponents: + Interpreter Core
versions: + Python 3.2, Python 3.3
2011-05-24 03:29:07r.david.murraysetnosy: + r.david.murray
messages: + msg136718
2011-05-24 02:10:26py.usercreate