]> granicus.if.org Git - python/commit
#21739: mention subtle difference between loops and listcomps in tutorial.
authorR David Murray <rdmurray@bitdance.com>
Wed, 1 Oct 2014 01:25:38 +0000 (21:25 -0400)
committerR David Murray <rdmurray@bitdance.com>
Wed, 1 Oct 2014 01:25:38 +0000 (21:25 -0400)
commit6bd68608ffb1a0366760a190864bb05c618559ab
treed632b58513fb31a3e18b7a45949d85c80d7b422c
parente6edc03a6147c7447741dc5b163730dcb44dda4c
#21739: mention subtle difference between loops and listcomps in tutorial.

We don't want to go into a full explanation of scopes at this point in the
tutorial, so we just mention that the loop creates or overwrites a persistent
variable while the listcomp doesn't.  Not mentioning this would lead someone
to incorrectly assume loops and listcomps were *completely* equivalent, which
would confuse them later.

Original patch by Rose Ames, tweaked to remove the word 'scope'.
Doc/tutorial/datastructures.rst