Correct documentation for skylark_dict.pop()
RELNOTES: None
@@ -98,18 +98,21 @@ public final class SkylarkDict<K, V> extends MutableMap<K, V>
name = "pop",
doc =
"Removes a <code>key</code> from the dict, and returns the associated value. "
- + "If entry with that key was found, return the specified <code>default</code> value;"
- + "if no default value was specified, fail instead.",
+ + "If no entry with that key was found, remove nothing and return the specified "
+ + "<code>default</code> value; if no default value was specified, fail instead.",
parameters = {
@Param(name = "key", type = Object.class, doc = "The key.", noneable = true),
- @Param(name = "default", type = Object.class, defaultValue = "unbound", named = true,
- noneable = true, doc = "a default value if the key is absent."),
+ @Param(
+ name = "default",
+ type = Object.class,
+ defaultValue = "unbound",
+ named = true,
+ noneable = true,
+ doc = "a default value if the key is absent."),
},
useLocation = true,
- useEnvironment = true
- )
- public Object pop(Object key, Object defaultValue,
- Location loc, Environment env)
+ useEnvironment = true)
+ public Object pop(Object key, Object defaultValue, Location loc, Environment env)
throws EvalException {
Object value = get(key);
if (value != null) {
