[Zope3-checkins] SVN: Zope3/trunk/src/zope/tales/tales.py Merge from 3.3 branch:

Philipp von Weitershausen philikon at philikon.de
Fri Jul 7 09:08:03 EDT 2006


Log message for revision 69023:
  Merge from 3.3 branch:
   Log message for revision 69022:
    Fix http://www.zope.org/Collectors/Zope3-dev/667: ZPT repeat "oddness"
  

Changed:
  U   Zope3/trunk/src/zope/tales/tales.py

-=-
Modified: Zope3/trunk/src/zope/tales/tales.py
===================================================================
--- Zope3/trunk/src/zope/tales/tales.py	2006-07-07 12:57:30 UTC (rev 69022)
+++ Zope3/trunk/src/zope/tales/tales.py	2006-07-07 13:08:02 UTC (rev 69023)
@@ -219,17 +219,17 @@
         >>> it.next()
         True
         >>> it.even()
-        False
+        True
         >>> it.next()
         True
         >>> it.even()
-        True
+        False
         >>> it.next()
         True
         >>> it.even()
-        False
+        True
         """
-        return not (self._nextIndex % 2)
+        return not ((self._nextIndex - 1) % 2)
 
     def odd(self):
         """Test whether the position is odd
@@ -239,17 +239,17 @@
         >>> it.next()
         True
         >>> it.odd()
-        True
+        False
         >>> it.next()
         True
         >>> it.odd()
-        False
+        True
         >>> it.next()
         True
         >>> it.odd()
-        True
+        False
         """
-        return bool(self._nextIndex % 2)
+        return bool((self._nextIndex - 1) % 2)
 
     def parity(self):
         """Return 'odd' or 'even' depending on the position's parity



More information about the Zope3-Checkins mailing list