]> kaliko git repositories - python-musicpd.git/commitdiff
mpd.py: don't use has_key()
authorJ. Alexander Treuman <jat@spatialrift.net>
Fri, 11 Sep 2009 23:22:11 +0000 (19:22 -0400)
committerJ. Alexander Treuman <jat@spatialrift.net>
Fri, 11 Sep 2009 23:22:11 +0000 (19:22 -0400)
key in obj is easier to read, and even a little faster.

mpd.py

diff --git a/mpd.py b/mpd.py
index 1704b7b7fc1e4b6b820f70fad09a343bb34ece30..62df3a1c80957950c2a28449cc6b4613c56650fc 100644 (file)
--- a/mpd.py
+++ b/mpd.py
@@ -215,7 +215,7 @@ class MPDClient(object):
                 if key in delimiters:
                     yield obj
                     obj = {}
-                elif obj.has_key(key):
+                elif key in obj:
                     if not isinstance(obj[key], list):
                         obj[key] = [obj[key], value]
                     else: