From 50e5f303688c434bbd0b6a6c1678f34a9f74fce6 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Wed, 4 Nov 2009 14:58:39 -0500 Subject: [PATCH] random --> arbitrary (thanks Lorenzo) --- native-datatypes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native-datatypes.html b/native-datatypes.html index 10781b4..deec0fc 100755 --- a/native-datatypes.html +++ b/native-datatypes.html @@ -711,7 +711,7 @@ KeyError: 21 File "<stdin>", line 1, in <module> KeyError: 'pop from an empty set'
    -
  1. The pop() method removes a single value from a set and returns the value. However, since sets are unordered, there is no “last” value in a set, so there is no way to control which value gets removed. It is essentially random. +
  2. The pop() method removes a single value from a set and returns the value. However, since sets are unordered, there is no “last” value in a set, so there is no way to control which value gets removed. It is completely arbitrary.
  3. The clear() method removes all values from a set, leaving you with an empty set. This is equivalent to a_set = set(), which would create a new empty set and overwrite the previous value of the a_set variable.
  4. Attempting to pop a value from an empty set will raise a KeyError exception.