[Checkins] SVN: Sandbox/malthe/chameleon.core/ Ensure argument uniqueness for macro functions over the combined set of scope and keyword arguments.

Hanno Schlichting plone at hannosch.info
Sat Nov 29 16:25:08 EST 2008


Log message for revision 93448:
  Ensure argument uniqueness for macro functions over the combined set of scope and keyword arguments.
  

Changed:
  U   Sandbox/malthe/chameleon.core/CHANGES.txt
  U   Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py

-=-
Modified: Sandbox/malthe/chameleon.core/CHANGES.txt
===================================================================
--- Sandbox/malthe/chameleon.core/CHANGES.txt	2008-11-29 21:15:27 UTC (rev 93447)
+++ Sandbox/malthe/chameleon.core/CHANGES.txt	2008-11-29 21:25:08 UTC (rev 93448)
@@ -4,6 +4,9 @@
 HEAD
 ~~~~
 
+- Ensure argument uniqueness for macro functions over the combined set of
+  scope and keyword arguments. [hannosch]
+
 - Protect all `itertools.chain` statements with an encapsulating set() to
   ensure uniqueness. [hannosch]
 

Modified: Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py
===================================================================
--- Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py	2008-11-29 21:15:27 UTC (rev 93447)
+++ Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py	2008-11-29 21:25:08 UTC (rev 93448)
@@ -415,10 +415,10 @@
             if 'xmlns' in self.element.attrib:
                 kwargs.append(('include_ns_attribute', repr(True)))
 
-            arguments = ", ".join(
-                tuple("%s=%s" % (arg, arg) for arg in \
-                      set(itertools.chain(*self.stream.scope)))+
-                tuple("%s=%s" % kwarg for kwarg in kwargs))
+            arguments = tuple("%s=%s" % (arg, arg) for arg in \
+                              itertools.chain(*self.stream.scope))+ \
+                        tuple("%s=%s" % kwarg for kwarg in kwargs)
+            arguments = ", ".join(set(arguments))
 
             value = types.value(
                 "%s.render(%s)" % (self.symbols.metal, arguments))



More information about the Checkins mailing list