1.1 --- a/lib/__builtins__/sequence.py Tue Nov 29 17:27:31 2016 +0100
1.2 +++ b/lib/__builtins__/sequence.py Tue Nov 29 17:29:42 2016 +0100
1.3 @@ -46,6 +46,22 @@
1.4
1.5 return str(b)
1.6
1.7 + def __contains__(self, value):
1.8 +
1.9 + "Return whether the list contains 'value'."
1.10 +
1.11 + # Perform a linear search of the sequence contents.
1.12 +
1.13 + for v in self:
1.14 +
1.15 + # Return True if the current value is equal to the specified one.
1.16 + # Note that this is not an identity test, but an equality test.
1.17 +
1.18 + if v == value:
1.19 + return True
1.20 +
1.21 + return False
1.22 +
1.23 def __getitem__(self, index):
1.24
1.25 "Return the item or slice specified by 'index'."