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:
Slam 2019-04-03 00:47:41 +03:00 committed by Miss Islington (bot)
parent 1c5fa5af8a
commit 76b387bf74
1 changed files with 1 additions and 1 deletions

View File

@ -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):