[docs] [issue17939] Misleading information about slice assignment in docs

Stefan Chrobot report at bugs.python.org
Wed May 8 23:31:40 CEST 2013

New submission from Stefan Chrobot:


The docs says:

"If the target is a slicing: The primary expression in the reference is evaluated. It should yield a mutable sequence object (such as a list). The assigned object should be a sequence object of the same type."

This seems wrong, because the assigned object can be any iterable:

a = [4, 5, 6]
a[0:0] = range(1, 4)
# a is now [1, 2, 3, 4, 5, 6]

assignee: docs at python
components: Documentation
messages: 188738
nosy: docs at python, stefanchrobot
priority: normal
severity: normal
status: open
title: Misleading information about slice assignment in docs
type: enhancement
versions: Python 3.3

Python tracker <report at bugs.python.org>

More information about the docs mailing list