aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/docs/skylark/concepts.md
diff options
context:
space:
mode:
authorGravatar Jon Brandvein <brandjon@google.com>2016-07-25 15:13:44 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-07-26 09:29:57 +0000
commit15775b24db1f0fea316e49a1e2d177e44cd4069d (patch)
treec1eb7d20562cf50b24a7668de57f15a046dffa3b /site/docs/skylark/concepts.md
parent1a1c7f6f25af3be17fc4f97a3308d54d70d74f23 (diff)
Allow lists to be modified while a For loop is iterating over them.
This does not affect the loop's iteration. Similar work is needed for comprehension For clauses. -- MOS_MIGRATED_REVID=128357769
Diffstat (limited to 'site/docs/skylark/concepts.md')
-rw-r--r--site/docs/skylark/concepts.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/site/docs/skylark/concepts.md b/site/docs/skylark/concepts.md
index 355a15f8c2..7388ab7e87 100644
--- a/site/docs/skylark/concepts.md
+++ b/site/docs/skylark/concepts.md
@@ -171,8 +171,10 @@ Python:
* Recursion is not allowed.
-* Loops iterate on a shallow copy of the elements. If the list is modified
- during the iteration, you will only see the old values.
+* Loops iterate over a shallow copy of the collection. If the collection is a
+ list or dictionary that is modified during iteration, this will not affect
+ what values get bound to the loop variable or variables. The changes are
+ still visible if you directly access the collection.
The following Python features are not supported: