[Zodb-checkins] CVS: Packages/ZConfig - Config.py:1.14.10.3
Fred L. Drake, Jr.
fred@zope.com
Wed, 11 Dec 2002 15:08:42 -0500
Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv20392
Modified Files:
Tag: zconfig-schema-devel-branch
Config.py
Log Message:
has_key(): Simplify, avoiding need for version compatibility hackery.
=== Packages/ZConfig/Config.py 1.14.10.2 => 1.14.10.3 ===
--- Packages/ZConfig/Config.py:1.14.10.2 Wed Dec 11 15:02:25 2002
+++ Packages/ZConfig/Config.py Wed Dec 11 15:08:41 2002
@@ -4,11 +4,6 @@
from ZConfig.datatypes import asBoolean
-try:
- True
-except NameError:
- True = 1
- False = 0
class Configuration:
def __init__(self, container, type, name, url):
@@ -105,12 +100,10 @@
def has_key(self, key):
key = key.lower()
- if self._data.has_key(key):
- return True
- elif self.delegate:
- return self.delegate.has_key(key)
- else:
- return False
+ have = self._data.has_key(key)
+ if self.delegate and not have:
+ have = self.delegate.has_key(key)
+ return have
def items(self):
"""Returns a list of key-value pairs for this section.