This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: The Python Tutorial 5.3. Tuples and Sequences
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Ben Schreib, SilentGhost, docs@python
Priority: normal Keywords:

Created on 2015-12-05 17:25 by Ben Schreib, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg255962 - (view) Author: Ben Schreib (Ben Schreib) Date: 2015-12-05 17:25
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
msg255963 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2015-12-05 17:45
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.
History
Date User Action Args
2022-04-11 14:58:24adminsetgithub: 69994
2015-12-05 17:45:46SilentGhostsetstatus: open -> closed

nosy: + SilentGhost
messages: + msg255963

resolution: not a bug
stage: resolved
2015-12-05 17:25:57Ben Schreibcreate