[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/pagetemplate.py Fixed opaque system modules dictionary; thanks to Jacob Holm for spotting this bug.

Malthe Borch mborch at gmail.com
Tue May 12 04:28:37 EDT 2009


Log message for revision 99864:
  Fixed opaque system modules dictionary; thanks to Jacob Holm for spotting this bug.

Changed:
  U   z3c.pt/trunk/src/z3c/pt/pagetemplate.py

-=-
Modified: z3c.pt/trunk/src/z3c/pt/pagetemplate.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/pagetemplate.py	2009-05-12 08:25:58 UTC (rev 99863)
+++ z3c.pt/trunk/src/z3c/pt/pagetemplate.py	2009-05-12 08:28:37 UTC (rev 99864)
@@ -23,10 +23,17 @@
 class opaque_dict(dict):
     def __new__(cls, dictionary):
         inst = dict.__new__(cls)
-        inst.__getitem__ = dictionary.__getitem__
-        inst.__len__ = dictionary.__len__
+        inst.dictionary = dictionary
         return inst
+    
+    @property
+    def __getitem__(self):
+        return self.dictionary.__getitem__
 
+    @property
+    def __len__(self):
+        return self.dictionary.__len__
+
     def __repr__(self):
         return "{...} (%d entries)" % len(self)
 



More information about the Checkins mailing list