[issue27370] Inconsistency in docs for list.extend

Andrew Cameron report at bugs.python.org
Wed Jun 22 14:29:00 EDT 2016


New submission from Andrew Cameron:

The documentation for Mutable Sequence Types states that, for operation:
s.extend(x) or s += t

the expected result is:
for the most part the same as s[len(s):len(s)] = x

Note that if you perform operation 's += t' the result is not the same as 's[len(s):len(s)] = x' unless 't == x'.

This does not occur with the Python 3 docs, which uses exclusively 't' (not 'x'). However for people reading the Python 2 docs the variable mix-up could cause confusion.

----------
assignee: docs at python
components: Documentation
messages: 269080
nosy: Andrew Cameron, docs at python
priority: normal
severity: normal
status: open
title: Inconsistency in docs for list.extend
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27370>
_______________________________________


More information about the Python-bugs-list mailing list