Iuri Diniz iuridi...@gmail.com added the comment:
Is this bug valid?
I have checked that only bytearray, bytes, list, range, str and tuple are valid
sequence types [using issubclass(type, collections.Sequence)] and all of them
has index and count methods...
I'm working on a script to
SilentGhost michael.mischurow+...@gmail.com added the comment:
Here is the patch for the table in Doc/library/stdtypes.rst
.count on range by some reason returns a boolean. Should it not be an int?
--
keywords: +patch
nosy: +SilentGhost
Added file:
Éric Araujo mer...@netwok.org added the comment:
Doc patch looks good.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9746
___
___
Iuri Diniz iuridi...@gmail.com added the comment:
Well, I think that script not more necessary
count problem: Issue10474
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9746
___
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Patch is fine. Go ahead and apply.
--
nosy: +rhettinger
resolution: - accepted
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9746
Éric Araujo mer...@netwok.org added the comment:
Patch committed in r86625 (py3k), r86627 (3.1) and r86627 (2.7).
Regarding API conformance, I ran this simple test, courtesy of Daniel in
msg109784:
for cls in str, bytes, bytearray, list, tuple, range:
... print(cls, [method for method in
Changes by Daniel Urban urban.dani...@gmail.com:
--
nosy: +durban
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9746
___
___
Python-bugs-list
Éric Araujo mer...@netwok.org added the comment:
For the person wanting to make a patch: Beware that the abstract
collections.Sequence.index method does not support the start and stop
arguments, even though concrete methods may (list.index, tuple.index and
str.index for example).
--
New submission from Daniel Stutzbach dan...@stutzbachenterprises.com:
In the list of operations supported by all sequence types, the .index and
.count methods should be included. They are defined by the
collections.Sequence ABC that all sequences support.
(except for range objects, but that