]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Tuples now have both count() and index().
authorRaymond Hettinger <python@rcn.com>
Tue, 22 Jul 2008 19:00:47 +0000 (19:00 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 22 Jul 2008 19:00:47 +0000 (19:00 +0000)
Doc/whatsnew/2.6.rst

index cf9682b86c8d113fc40230ea562f670d547c4d2b..f895f80fe55ce2e734a75b5a0d04ccad01a2f09c 100644 (file)
@@ -1441,13 +1441,15 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
   it will be returned if *iterator* has been exhausted; otherwise,
   the :exc:`StopIteration` exception will be raised.  (:issue:`2719`)
 
-* Tuples now have an :meth:`index` method matching the list type's
-  :meth:`index` method::
+* Tuples now have :meth:`index` and :meth:`count` methods matching the
+  list type's :meth:`index` and :meth:`count` methods::
 
     >>> t = (0,1,2,3,4)
     >>> t.index(3)
     3
 
+  (Contributed by Raymond Hettinger)
+
 * The built-in types now have improved support for extended slicing syntax,
   where various combinations of ``(start, stop, step)`` are supplied.
   Previously, the support was partial and certain corner cases wouldn't work.