Raymond Hettinger added the comment:
There isn't much defense against an overly literal reading of the docs. Both
``s.pop([i])`` and ``s.pop(i=-1)`` fail (the latter because pop doesn't take
key word arguments and the docstring calls it index. Also, you would have to
define *s* and *i*.
Eric V. Smith added the comment:
I don't feel particularly strongly about it. It's mildly more confusing in the
3.x docs than 2.7 because it's the only use in that section of an optional
argument.
I disagree that s.pop(i) is wrong, since it agrees with the Results column.
But I agree it's
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: docs@python - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24323
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - not a bug
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24323
___
Eric V. Smith added the comment:
It's trying to say that i is optional, as stated in the footnote. I agree it
would be better written as s.pop(i), since square brackets are otherwise used
in that section as indexing operators. But the footnote should stay, explaining
what happens if you omit
Changes by Eric V. Smith e...@trueblade.com:
--
versions: -Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24323
___
___
New submission from eimista:
In section
(https://docs.python.org/3.5/library/stdtypes.html#mutable-sequence-types)
written s.pop([i]). But this syntax doesn't work.
Maybe the correct notation will be s.pop(i)?
--
assignee: docs@python
components: Documentation
messages: 244365
nosy:
Yury Selivanov added the comment:
I think it should be changed to `pop(i=-1)`.
--
nosy: +yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24323
___
Eric V. Smith added the comment:
s.pop(i=-1) doesn't actually work, but I guess it gets the point across.
For 2.7 it's even more confusing, since it includes:
s.index(x[, i[, j]])
and
s.sort([cmp[, key[, reverse]]])
I'd suggest not changing the 2.7 docs.
--