cpython: cabd7261ae80 (original) (raw)

Mercurial > cpython

changeset 96227:cabd7261ae80

Issue #23086: Add start and stop arguments to the Sequence.index() mixin method. [#23086]

Raymond Hettinger python@rcn.com
date Fri, 22 May 2015 19:29:22 -0700
parents 29b95625a07c
children e729b946cc03
files Doc/library/collections.abc.rst Lib/_collections_abc.py Lib/test/test_collections.py Misc/ACKS Misc/NEWS
diffstat 5 files changed, 69 insertions(+), 5 deletions(-)[+] [-] Doc/library/collections.abc.rst 14 Lib/_collections_abc.py 20 Lib/test/test_collections.py 35 Misc/ACKS 1 Misc/NEWS 4

line wrap: on

line diff

--- a/Doc/library/collections.abc.rst +++ b/Doc/library/collections.abc.rst @@ -121,6 +121,20 @@ ABC Inherits from ABCs for read-only and mutable :term:sequences <sequence>.

+ + .. class:: Set MutableSet

--- a/Lib/_collections_abc.py +++ b/Lib/_collections_abc.py @@ -825,13 +825,23 @@ class Sequence(Sized, Iterable, Containe for i in reversed(range(len(self))): yield self[i]

+

def count(self, value):

--- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -1227,6 +1227,41 @@ class TestCollectionABCs(ABCTestCase): self.validate_abstract_methods(Sequence, 'contains', 'iter', 'len', 'getitem')

+

+

+

+

+ def test_ByteString(self): for sample in [bytes, bytearray]: self.assertIsInstance(sample(), ByteString)

--- a/Misc/ACKS +++ b/Misc/ACKS @@ -660,6 +660,7 @@ Bill Janssen Thomas Jarosch Juhana Jauhiainen Rajagopalasarma Jayakrishnan +Devin Jeanpierre Zbigniew Jędrzejewski-Szmek Julien Jehannet Muhammad Jehanzeb

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -73,6 +73,10 @@ Library