[pypy-svn] r76729 - pypy/branch/better-map-instances/pypy/objspace/std

arigo at codespeak.net arigo at codespeak.net
Wed Aug 25 17:20:00 CEST 2010


Author: arigo
Date: Wed Aug 25 17:19:58 2010
New Revision: 76729

Modified:
   pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py
Log:
Comments, (bad) implementation of clear().


Modified: pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py
==============================================================================
--- pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py	(original)
+++ pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py	Wed Aug 25 17:19:58 2010
@@ -355,7 +355,9 @@
         return MapDictIteratorImplementation(self.space, self)
 
     def impl_clear(self):
-        XXX     # implement me!
+        # XXX implement me better, or provide a reasonable default
+        # XXX implementation in W_DictMultiObject
+        self._as_rdict().clear()
 
     def _clear_fields(self):
         self.w_obj = None
@@ -367,6 +369,9 @@
         materialize_r_dict(space, w_obj, self)
         self._clear_fields()
         return self
+        # XXX then the calls self._as_rdict().method() from above look like
+        # recursive calls, and a stack check is inserted, which is pointless.
+        # It would be better to return self.r_dict_content, I think
 
 
 def materialize_r_dict(space, obj, w_d):



More information about the Pypy-commit mailing list