diff --git a/spec.md b/spec.md index e41c223..7df6398 100644 --- a/spec.md +++ b/spec.md @@ -135,6 +135,7 @@ interact with the environment. * [zip](#zip) * [Built-in methods](#built-in-methods) * [bytes·elems](#bytes·elems) + * [dict·clear](#dict·clear) * [dict·get](#dict·get) * [dict·items](#dict·items) * [dict·keys](#dict·keys) @@ -3450,6 +3451,18 @@ list(b"ABC".elems()) # [65, 66, 67] ``` + +### dict·clear + +`D.clear()` removes all the entries of dictionary D and returns `None`. +It fails if the dictionary is frozen or if there are active iterators. + +```python +x = {"one": 1, "two": 2} +x.clear() # None +print(x) # {} +``` + ### dict·get