Have UserDict.__init__() implicitly check for updating w/ bool(kwargs) instead of len() (GH-12139)
Semantically the same, but more idiomatic by checking against `kwargs` instead of `len(kwargs)`.
This commit is contained in:
parent
1c5fa5af8a
commit
76b387bf74
|
@ -1016,7 +1016,7 @@ class UserDict(_collections_abc.MutableMapping):
|
|||
self.data = {}
|
||||
if dict is not None:
|
||||
self.update(dict)
|
||||
if len(kwargs):
|
||||
if kwargs:
|
||||
self.update(kwargs)
|
||||
def __len__(self): return len(self.data)
|
||||
def __getitem__(self, key):
|
||||
|
|
Loading…
Reference in New Issue