[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/ Lambda-functions can't be pickled; use proper module-level identity-method.

Malthe Borch mborch at gmail.com
Tue Sep 9 09:36:54 EDT 2008


Log message for revision 90997:
  Lambda-functions can't be pickled; use proper module-level identity-method.

Changed:
  U   z3c.pt/trunk/src/z3c/pt/expressions.py
  U   z3c.pt/trunk/src/z3c/pt/utils.py

-=-
Modified: z3c.pt/trunk/src/z3c/pt/expressions.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/expressions.py	2008-09-09 13:36:20 UTC (rev 90996)
+++ z3c.pt/trunk/src/z3c/pt/expressions.py	2008-09-09 13:36:54 UTC (rev 90997)
@@ -8,6 +8,7 @@
 import interfaces
 import types
 import config
+import utils
 
 _marker = object()
 
@@ -644,7 +645,7 @@
 class ZopeTraverser(object):
     def __init__(self, proxify=None):
         if proxify is None:
-            self.proxify = lambda x: x
+            self.proxify = utils.identity
         else:
             self.proxify = proxify
 

Modified: z3c.pt/trunk/src/z3c/pt/utils.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/utils.py	2008-09-09 13:36:20 UTC (rev 90996)
+++ z3c.pt/trunk/src/z3c/pt/utils.py	2008-09-09 13:36:54 UTC (rev 90997)
@@ -71,6 +71,9 @@
         
     return string
 
+def identity(x):
+    return x
+
 class scope(list):
     def __init__(self, *args):
         global s_counter



More information about the Checkins mailing list