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

The Python Tutorial 5.3. Tuples and Sequences #69994

Closed
BenSchreib mannequin opened this issue Dec 5, 2015 · 2 comments
Closed

The Python Tutorial 5.3. Tuples and Sequences #69994

BenSchreib mannequin opened this issue Dec 5, 2015 · 2 comments
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@BenSchreib
Copy link
Mannequin

BenSchreib mannequin commented Dec 5, 2015

BPO 25808

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 2015-12-05.17:45:46.629>
created_at = <Date 2015-12-05.17:25:57.654>
labels = ['type-feature', 'invalid', 'docs']
title = 'The Python Tutorial 5.3. Tuples and Sequences'
updated_at = <Date 2015-12-05.17:45:46.627>
user = 'https://bugs.python.org/BenSchreib'

bugs.python.org fields:

activity = <Date 2015-12-05.17:45:46.627>
actor = 'SilentGhost'
assignee = 'docs@python'
closed = True
closed_date = <Date 2015-12-05.17:45:46.629>
closer = 'SilentGhost'
components = ['Documentation']
creation = <Date 2015-12-05.17:25:57.654>
creator = 'Ben Schreib'
dependencies = []
files = []
hgrepos = []
issue_num = 25808
keywords = []
message_count = 2.0
messages = ['255962', '255963']
nosy_count = 3.0
nosy_names = ['SilentGhost', 'docs@python', 'Ben Schreib']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue25808'
versions = ['Python 3.5']

@BenSchreib
Copy link
Mannequin Author

BenSchreib mannequin commented Dec 5, 2015

The example given in section 5.3 shows an output of "t[0] = 88888" but I believe it should be "t[0] = 12345"

>>> t
(12345, 54321, 'hello!')
>>> # Tuples may be nested:
... u = t, (1, 2, 3, 4, 5)
>>> u
((12345, 54321, 'hello!'), (1, 2, 3, 4, 5))
>>> # Tuples are immutable:
... t[0] = 88888

@BenSchreib BenSchreib mannequin assigned docspython Dec 5, 2015
@BenSchreib BenSchreib mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Dec 5, 2015
@SilentGhost
Copy link
Mannequin

SilentGhost mannequin commented Dec 5, 2015

No, what this piece of code shows is that trying to assign a value to a tuple element will cause an error. Of course, the same error would be raise when using the the value 12345, but it's more instructive to use a different value to not confuse the reader.

@SilentGhost SilentGhost mannequin closed this as completed Dec 5, 2015
@SilentGhost SilentGhost mannequin added the invalid label Dec 5, 2015
@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 type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

0 participants