[docs] provide the authorative source for s[i:j] negative slice indices (<-len(s)) behavior for standard sequences (issue 29352)
shadowranger+python at gmail.com
shadowranger+python at gmail.com
Tue Jan 24 13:45:12 EST 2017
https://bugs.python.org/review/29352/diff/19815/Doc/library/stdtypes.rst
File Doc/library/stdtypes.rst (right):
https://bugs.python.org/review/29352/diff/19815/Doc/library/stdtypes.rst#newcode937
Doc/library/stdtypes.rst:937: ``len(s)``. If ``len(s) + i`` or ``len(s)
+ j`` is negative, use ``0``. If *i*
I think, to avoid repetition, a footnote cross-reference might make more
sense here:
"If a negative index remains negative after substitution (Note 3), use
``0``."
Or if footnote cross-references are verboten, to match the phrasing for
the previous sentence and simplify the language:
"If *i* or *j* is less than ``-len(s)``, use ``0``."
https://bugs.python.org/review/29352/
More information about the docs
mailing list