Author: Manuel Jacob
Branch: remove-list-smm-2
Changeset: r64260:7fa96304949d
Date: 2013-05-17 15:30 +0200
http://bitbucket.org/pypy/pypy/changeset/7fa96304949d/
Log: Remove list from multi-method table.
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -1,6 +1,3 @@
-from pypy.objspace.std.model import registerimplementation, W_Object
-from pypy.objspace.std.register_all import register_all
-from pypy.objspace.std.multimethod import FailedToImplement
from pypy.interpreter.error import OperationError, operationerrfmt
from pypy.interpreter.generator import GeneratorIterator
from pypy.objspace.std.inttype import wrapint
@@ -9,6 +6,7 @@
from pypy.interpreter.gateway import WrappedDefault, unwrap_spec, applevel,\
interp2app
from pypy.interpreter import baseobjspace
+from pypy.interpreter.baseobjspace import W_Root
from pypy.interpreter.signature import Signature
from rpython.rlib.objectmodel import (instantiate, newlist_hint, specialize,
resizelist_hint)
@@ -22,7 +20,7 @@
UNROLL_CUTOFF = 5
-class W_AbstractListObject(W_Object):
+class W_AbstractListObject(W_Root):
__slots__ = ()
def make_range_list(space, start, step, length):
@@ -678,8 +676,6 @@
return space.w_None
-registerimplementation(W_ListObject)
-
class ListStrategy(object):
sizehint = -1
@@ -1676,12 +1672,9 @@
# ____________________________________________________________
-# ____________________________________________________________
-
def get_list_index(space, w_index):
return space.getindex_w(w_index, space.w_IndexError, "list index")
-register_all(vars(), globals())
W_ListObject.typedef = StdTypeDef("list",
__doc__ = """list() -> new list
@@ -1726,6 +1719,3 @@
insert = interp2app(W_ListObject.descr_insert),
remove = interp2app(W_ListObject.descr_remove),
)
-W_ListObject.typedef.registermethods(globals())
-
-list_typedef = W_ListObject.typedef
diff --git a/pypy/objspace/std/model.py b/pypy/objspace/std/model.py
--- a/pypy/objspace/std/model.py
+++ b/pypy/objspace/std/model.py
@@ -39,7 +39,6 @@
from pypy.objspace.std.floattype import float_typedef
from pypy.objspace.std.complextype import complex_typedef
from pypy.objspace.std.tupletype import tuple_typedef
- from pypy.objspace.std.listobject import list_typedef
from pypy.objspace.std.basestringtype import basestring_typedef
from pypy.objspace.std.stringtype import str_typedef
from pypy.objspace.std.bytearraytype import bytearray_typedef
@@ -80,6 +79,7 @@
# not-multimethod based types
+ self.pythontypes.append(listobject.W_ListObject.typedef)
self.pythontypes.append(dictmultiobject.W_DictMultiObject.typedef)
self.pythontypes.append(setobject.W_SetObject.typedef)
self.pythontypes.append(setobject.W_FrozensetObject.typedef)
@@ -91,7 +91,6 @@
intobject.W_IntObject: [],
floatobject.W_FloatObject: [],
tupleobject.W_TupleObject: [],
- listobject.W_ListObject: [],
stringobject.W_StringObject: [],
bytearrayobject.W_BytearrayObject: [],
typeobject.W_TypeObject: [],
@@ -109,11 +108,6 @@
}
self.imported_but_not_registered = {
- dictmultiobject.W_DictMultiObject: True, # XXXXXX
- dictmultiobject.W_DictMultiIterKeysObject: True,
- dictmultiobject.W_DictMultiIterValuesObject: True,
- dictmultiobject.W_DictMultiIterItemsObject: True,
- listobject.W_ListObject: True,
stringobject.W_StringObject: True,
tupleobject.W_TupleObject: True,
}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit