[Python-checkins] r69048 - in sandbox/trunk/ttk-gsoc/src: 2.x/ttk.py 3.x/ttk.py

guilherme.polo python-checkins at python.org
Wed Jan 28 13:43:56 CET 2009


Author: guilherme.polo
Date: Wed Jan 28 13:43:56 2009
New Revision: 69048

Log:
Simpler zipping.


Modified:
   sandbox/trunk/ttk-gsoc/src/2.x/ttk.py
   sandbox/trunk/ttk-gsoc/src/3.x/ttk.py

Modified: sandbox/trunk/ttk-gsoc/src/2.x/ttk.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/2.x/ttk.py	(original)
+++ sandbox/trunk/ttk-gsoc/src/2.x/ttk.py	Wed Jan 28 13:43:56 2009
@@ -12,7 +12,7 @@
 of the widgets appearance lies at Themes.
 """
 
-__version__ = "0.3"
+__version__ = "0.3.1"
 
 __author__ = "Guilherme Polo <ggpolo at gmail.com>"
 
@@ -266,7 +266,8 @@
     opt_start = 1 if cut_minus else 0
 
     retdict = {}
-    for opt, val in zip(iter(ttuple[::2]), iter(ttuple[1::2])):
+    it = iter(ttuple)
+    for opt, val in zip(it, it):
         retdict[str(opt)[opt_start:]] = val
 
     return tclobjs_to_py(retdict)
@@ -285,7 +286,8 @@
                 val = val.split()
             nval.append(val)
 
-    return [_flatten(spec) for spec in zip(iter(nval[::2]), iter(nval[1::2]))]
+    it = iter(nval)
+    return [_flatten(spec) for spec in zip(it, it)]
 
 def _list_from_layouttuple(ltuple):
     """Construct a list from the tuple returned by ttk::layout, this is

Modified: sandbox/trunk/ttk-gsoc/src/3.x/ttk.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/3.x/ttk.py	(original)
+++ sandbox/trunk/ttk-gsoc/src/3.x/ttk.py	Wed Jan 28 13:43:56 2009
@@ -12,7 +12,7 @@
 of the widgets appearance lies at Themes.
 """
 
-__version__ = "0.3"
+__version__ = "0.3.1"
 
 __author__ = "Guilherme Polo <ggpolo at gmail.com>"
 
@@ -266,7 +266,8 @@
     opt_start = 1 if cut_minus else 0
 
     retdict = {}
-    for opt, val in zip(iter(ttuple[::2]), iter(ttuple[1::2])):
+    it = iter(ttuple)
+    for opt, val in zip(it, it):
         retdict[str(opt)[opt_start:]] = val
 
     return tclobjs_to_py(retdict)
@@ -285,7 +286,8 @@
                 val = val.split()
             nval.append(val)
 
-    return [_flatten(spec) for spec in zip(iter(nval[::2]), iter(nval[1::2]))]
+    it = iter(nval)
+    return [_flatten(spec) for spec in zip(it, it)]
 
 def _list_from_layouttuple(ltuple):
     """Construct a list from the tuple returned by ttk::layout, this is


More information about the Python-checkins mailing list