[Zope3-checkins] SVN: Zope3/branches/3.3/ Fix http://www.zope.org/Collectors/Zope3-dev/667: ZPT repeat "oddness"

Philipp von Weitershausen philikon at philikon.de
Fri Jul 7 08:57:30 EDT 2006


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

Changed:
  U   Zope3/branches/3.3/doc/CHANGES.txt
  U   Zope3/branches/3.3/src/zope/tales/tales.py

-=-
Modified: Zope3/branches/3.3/doc/CHANGES.txt
===================================================================
--- Zope3/branches/3.3/doc/CHANGES.txt	2006-07-07 12:17:19 UTC (rev 69021)
+++ Zope3/branches/3.3/doc/CHANGES.txt	2006-07-07 12:57:30 UTC (rev 69022)
@@ -10,6 +10,8 @@
 
     Bugfixes
 
+      - Fixed issue 667: ZPT repeat "oddness"
+
       - Fixed issue 646: TAL interpreter doesn't translate i18n
         Messages when inserted as attributes;
 

Modified: Zope3/branches/3.3/src/zope/tales/tales.py
===================================================================
--- Zope3/branches/3.3/src/zope/tales/tales.py	2006-07-07 12:17:19 UTC (rev 69021)
+++ Zope3/branches/3.3/src/zope/tales/tales.py	2006-07-07 12:57:30 UTC (rev 69022)
@@ -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