Eric V. Smith added the comment:
I'm currently working on an update to PEP-498 to address this. I hope to have it completed after a sprint this weekend.
Python tracker <report(a)bugs.python.org>
On 2016/11/02 14:28:21, ChrisRands wrote:
> Thanks to Mariatta for the patch, which addresses the issue, so I
think it can
> be applied to the Python 3 and 2 documentation. One point, I do not
> the start and stop arguments were added to list.count (or if they
> existed). I have only tested them in Python2.7 and Python3.5.
Thanks ChrisRands :)
I'm a bit confused with your comment about list.count. list.count does
not take start, stop arguments.
Perhaps you are thinking about str.count which has been documented
Thanks to Mariatta for the patch, which addresses the issue, so I think
it can be applied to the Python 3 and 2 documentation. One point, I do
not know when the start and stop arguments were added to list.count (or
if they always existed). I have only tested them in Python2.7 and
Please review this at http://bugs.python.org/review/28587/
diff -r 0c8ffa562f3a Doc/tutorial/datastructures.rst
--- a/Doc/tutorial/datastructures.rst Wed Nov 02 12:13:48 2016 +0200
+++ b/Doc/tutorial/datastructures.rst Wed Nov 02 06:04:14 2016 -0700
@@ -60,11 +60,12 @@
Remove all items from the list. Equivalent to ``del a[:]``.
-.. method:: list.index(x)
+.. method:: list.index(x[, start[, end]])
Return the index in the list of the first item whose value is *x*. It is an
- error if there is no such item.
+ error if there is no such item. Optional arguments ``start`` and ``end``
+ are interpreted as in slice notation.
.. method:: list.count(x)
@@ -101,8 +102,8 @@
[66.25, 333, -1, 333, 1, 1234.5, 333]
- >>> a.index(333)
+ >>> a.index(333, 2)
[66.25, -1, 333, 1, 1234.5, 333]