mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Give UserDict new __contains__ and __iter__ methods.
This commit is contained in:
parent
e99b97e58a
commit
a3f98d6bac
2 changed files with 19 additions and 1 deletions
|
|
@ -40,3 +40,7 @@ class UserDict:
|
|||
return self.data[key]
|
||||
def popitem(self):
|
||||
return self.data.popitem()
|
||||
def __contains__(self, key):
|
||||
return key in self.data
|
||||
def __iter__(self):
|
||||
return iter(self.data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue