diff options
author | Slam <3lnc.slam@gmail.com> | 2019-04-02 21:47:41 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-04-02 21:47:41 (GMT) |
commit | 76b387bf7402863c5e64e3459e2f91ddc3b9d2d3 (patch) | |
tree | 65bb8972e9a945041ab7d35424a5c2f197afbfcd /Lib/collections | |
parent | 1c5fa5af8a95f25119e45e40a4ed8183d06f4a5b (diff) | |
download | cpython-76b387bf7402863c5e64e3459e2f91ddc3b9d2d3.zip cpython-76b387bf7402863c5e64e3459e2f91ddc3b9d2d3.tar.gz cpython-76b387bf7402863c5e64e3459e2f91ddc3b9d2d3.tar.bz2 |
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)`.
Diffstat (limited to 'Lib/collections')
-rw-r--r-- | Lib/collections/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index cff75a4..9657c1c 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -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): |