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 1704b7b..62df3a1 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: