aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGravatar vladmos <vladmos@google.com>2018-02-22 07:52:30 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-22 07:54:01 -0800
commitd605a62eb9908fe44c89a2ed10f88f633c4dcb3e (patch)
treefb4cd9d1e5685e91e3a570a3b4e3caa7544a43eb /src/main/java/com
parentf6cbbeedc593781a111ac787e512fd485d605fcf (diff)
Define the dict iteration order
PiperOrigin-RevId: 186616752
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/SkylarkDict.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkDict.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkDict.java
index fc9da3a177..3cd3f999bb 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkDict.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkDict.java
@@ -51,7 +51,9 @@ import javax.annotation.Nullable;
+ "<code>in</code> operator tests for membership in the keyset of the dict.<br>"
+ "<pre class=\"language-python\">\"a\" in {\"a\" : 2, \"b\" : 5} "
+ "# evaluates as True</pre>"
- + "The iteration order for a dict is deterministic but not specified."
+ + "The iteration order for a dict is deterministic and specified as the order in which "
+ + "the keys have been added to the dict. The iteration order is not affected if a value "
+ + "associated with an existing key is updated."
)
public final class SkylarkDict<K, V> extends MutableMap<K, V>
implements Map<K, V>, SkylarkIndexable {