Commit 76b387bf authored by Slam's avatar Slam Committed by Miss Islington (bot)

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)`.
parent 1c5fa5af
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment