[issue9746] All sequence types support .index and .count

2010-11-20 Thread Iuri Diniz
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

[issue9746] All sequence types support .index and .count

2010-11-20 Thread SilentGhost
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:

[issue9746] All sequence types support .index and .count

2010-11-20 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Doc patch looks good. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9746 ___ ___

[issue9746] All sequence types support .index and .count

2010-11-20 Thread Iuri Diniz
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 ___

[issue9746] All sequence types support .index and .count

2010-11-20 Thread Raymond Hettinger
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

[issue9746] All sequence types support .index and .count

2010-11-20 Thread Éric Araujo
É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

[issue9746] All sequence types support .index and .count

2010-09-15 Thread Daniel Urban
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9746 ___ ___ Python-bugs-list

[issue9746] All sequence types support .index and .count

2010-09-11 Thread Éric Araujo
É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). --

[issue9746] All sequence types support .index and .count

2010-09-02 Thread Daniel Stutzbach
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