Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.3.6.4 Error in append and extend descriptions #44492

Closed
arafin mannequin opened this issue Jan 21, 2007 · 2 comments
Closed

2.3.6.4 Error in append and extend descriptions #44492

arafin mannequin opened this issue Jan 21, 2007 · 2 comments
Labels
docs Documentation in the Doc dir

Comments

@arafin
Copy link
Mannequin

arafin mannequin commented Jan 21, 2007

BPO 1641109
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2007-01-22.08:20:03.000>
created_at = <Date 2007-01-21.23:34:30.000>
labels = ['invalid', 'docs']
title = '2.3.6.4 Error in append and extend descriptions'
updated_at = <Date 2007-01-22.08:20:03.000>
user = 'https://bugs.python.org/arafin'

bugs.python.org fields:

activity = <Date 2007-01-22.08:20:03.000>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2007-01-21.23:34:30.000>
creator = 'arafin'
dependencies = []
files = []
hgrepos = []
issue_num = 1641109
keywords = []
message_count = 2.0
messages = ['31071', '31072']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'arafin']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1641109'
versions = []

@arafin
Copy link
Mannequin Author

arafin mannequin commented Jan 21, 2007

2.3.6.4 Mutable Sequence Types (2.4.4 Python Doc)

Error in the table describing append and extend operations for the list type.

specificaly:

s.append(x) same as s[len(s):len(s)] = [x] (2)
s.extend(x) same as s[len(s):len(s)] = x (3)

should be:

s.append(x) same as s[len(s):len(s)] = x (2)
s.extend(x) same as s[len(s):len(s)] = [x] (3)

@arafin arafin mannequin closed this as completed Jan 21, 2007
@arafin arafin mannequin added invalid docs Documentation in the Doc dir labels Jan 21, 2007
@arafin arafin mannequin closed this as completed Jan 21, 2007
@arafin arafin mannequin added invalid docs Documentation in the Doc dir labels Jan 21, 2007
@birkenfeld
Copy link
Member

Have you tried the original code and your corrections?
If you do, you'll find that the original is correct.

(In extend, x is already a sequence, so you mustn't wrap it in a list.
In append, you want only one element added, so you wrap x in a list.)

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant