dabo Commit
Revision 6245
Date: 2010-12-12 08:16:15 -0800 (Sun, 12 Dec 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6245

Changed:
U   trunk/dabo/dPref.py

Log:
Added the __contains__() method so that pref objects support the "x in y" 
syntax for determining if a key exists in a given preference object.

Diff:
Modified: trunk/dabo/dPref.py
===================================================================
--- trunk/dabo/dPref.py 2010-12-12 13:29:11 UTC (rev 6244)
+++ trunk/dabo/dPref.py 2010-12-12 16:16:15 UTC (rev 6245)
@@ -378,6 +378,7 @@
        def hasKey(self, key):
                """Provides a way to test for a key without automatically 
adding it."""
                return key in self.getPrefKeys()
+       __contains__ = hasKey
 
 
        def getSubPrefKeys(self, spec=None):



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to