Author: Lukas Diekmann <[email protected]>
Branch: set-strategies
Changeset: r49191:e87c1f05838a
Date: 2011-07-22 11:26 +0200
http://bitbucket.org/pypy/pypy/changeset/e87c1f05838a/

Log:    differentiation between set types happens in W_SetObject and
        W_FrozenSetObject (more OO)

diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py
--- a/pypy/objspace/std/setobject.py
+++ b/pypy/objspace/std/setobject.py
@@ -37,12 +37,7 @@
 
     def from_storage_and_strategy(w_self, storage, strategy):
         objtype = type(w_self)
-        if objtype is W_SetObject:
-            obj = instantiate(W_SetObject)
-        elif objtype is W_FrozensetObject:
-            obj = instantiate(W_FrozensetObject)
-        else:
-            obj = w_self.space.call_function(w_self.space.type(w_self), None)
+        obj = w_self._newobj(w_self.space, None)
         assert isinstance(obj, W_BaseSetObject)
         obj.strategy = strategy
         obj.sstorage = storage
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to