[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/security/checker.py Fix Python 2.4 compatibility.

Fred L. Drake, Jr. fred at zope.com
Wed Jun 23 15:38:22 EDT 2004


Log message for revision 25958:
Fix Python 2.4 compatibility.

While Python 2.3 used a single iterator type to support iteration over
dictionaries, Python 2.4 uses different types to support items, keys,
and values iterations.  We need to make sure declarations are made for
all of these types.



-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/security/checker.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/security/checker.py	2004-06-23 18:52:36 UTC (rev 25957)
+++ Zope3/branches/ZopeX3-3.0/src/zope/security/checker.py	2004-06-23 19:38:21 UTC (rev 25958)
@@ -747,6 +747,9 @@
     type(iter([])): _iteratorChecker, # Same types in Python 2.2.1,
     type(iter(())): _iteratorChecker, # different in Python 2.3.
     type(iter({})): _iteratorChecker,
+    type({}.iteritems()): _iteratorChecker,
+    type({}.iterkeys()): _iteratorChecker,
+    type({}.itervalues()): _iteratorChecker,
     type(iter(_Sequence())): _iteratorChecker,
     type(f()): _iteratorChecker,
     type(Interface): InterfaceChecker(



More information about the Zope3-Checkins mailing list