[pypy-svn] r73109 - in pypy/branch/cleanup-objspace-init/pypy/objspace/std: . test
benjamin at codespeak.net
benjamin at codespeak.net
Mon Mar 29 19:31:25 CEST 2010
Author: benjamin
Date: Mon Mar 29 19:31:23 2010
New Revision: 73109
Modified:
pypy/branch/cleanup-objspace-init/pypy/objspace/std/complextype.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/default.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/frozensettype.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/objspace.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/settype.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_complexobject.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_floatobject.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_intobject.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_longobject.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_smallintobject.py
pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_typeobject.py
Log:
cleanup imports
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/complextype.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/complextype.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/complextype.py Mon Mar 29 19:31:23 2010
@@ -1,7 +1,7 @@
from pypy.interpreter.error import OperationError
from pypy.interpreter import gateway
+from pypy.objspace.std.register_all import register_all
from pypy.objspace.std.strutil import interp_string_to_float, ParseStringError
-from pypy.objspace.std.objspace import register_all
from pypy.objspace.std.noneobject import W_NoneObject
from pypy.objspace.std.stdtypedef import GetSetProperty, StdTypeDef, newmethod
from pypy.objspace.std.stdtypedef import StdObjSpaceMultiMethod
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/default.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/default.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/default.py Mon Mar 29 19:31:23 2010
@@ -1,6 +1,7 @@
"""Default implementation for some operation."""
-from pypy.objspace.std.objspace import *
+from pypy.interpreter.error import OperationError
+from pypy.objspace.std.register_all import register_all
from pypy.rlib import objectmodel
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/frozensettype.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/frozensettype.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/frozensettype.py Mon Mar 29 19:31:23 2010
@@ -1,5 +1,5 @@
from pypy.interpreter.error import OperationError
-from pypy.objspace.std.objspace import register_all
+from pypy.objspace.std.register_all import register_all
from pypy.objspace.std.stdtypedef import StdTypeDef, newmethod
from pypy.objspace.std.stdtypedef import SMM
from pypy.interpreter.gateway import NoneNotWrapped
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/objspace.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/objspace.py Mon Mar 29 19:31:23 2010
@@ -1,27 +1,17 @@
-from pypy.objspace.std.register_all import register_all
+import __builtin__
+from pypy.interpreter import pyframe, function
from pypy.interpreter.baseobjspace import ObjSpace, Wrappable, UnpackValueError
-from pypy.interpreter.error import OperationError, operationerrfmt, debug_print
+from pypy.interpreter.error import OperationError, operationerrfmt
from pypy.interpreter.typedef import get_unique_interplevel_subclass
-from pypy.interpreter import pyframe, function
+from pypy.objspace.std import stdtypedef, frame, model
+from pypy.objspace.descroperation import DescrOperation, raiseattrerror
from pypy.rlib.objectmodel import instantiate
from pypy.rlib.debug import make_sure_not_resized
-from pypy.interpreter.gateway import PyPyCacheDir
-from pypy.tool.cache import Cache
-from pypy.tool.sourcetools import func_with_new_name
-from pypy.objspace.std import model
-from pypy.objspace.std.model import W_Object, UnwrapError
-from pypy.objspace.std.model import W_ANY, StdObjSpaceMultiMethod, StdTypeModel
-from pypy.objspace.std.multimethod import FailedToImplement, FailedToImplementArgs
-from pypy.objspace.descroperation import DescrOperation, raiseattrerror
-from pypy.objspace.std import stdtypedef, frame
from pypy.rlib.rarithmetic import base_int
from pypy.rlib.objectmodel import we_are_translated
from pypy.rlib.jit import hint
-import sys
-import os
-import __builtin__
+from pypy.tool.sourcetools import func_with_new_name
-##################################################################
class StdObjSpace(ObjSpace, DescrOperation):
"""The standard object space, implementing a general-purpose object
@@ -30,7 +20,7 @@
def initialize(self):
"NOT_RPYTHON: only for initializing the space."
# Import all the object types and implementations
- self.model = StdTypeModel(self.config)
+ self.model = model.StdTypeModel(self.config)
self.FrameClass = frame.build_frame(self)
@@ -51,7 +41,7 @@
# install all the MultiMethods into the space instance
for name, mm in model.MM.__dict__.items():
- if not isinstance(mm, StdObjSpaceMultiMethod):
+ if not isinstance(mm, model.StdObjSpaceMultiMethod):
continue
if not hasattr(self, name):
if name.endswith('_w'): # int_w, str_w...: these do not return a wrapped object
@@ -183,7 +173,7 @@
# annotation (see pypy/annotation/builtin.py)
if x is None:
return self.w_None
- if isinstance(x, W_Object):
+ if isinstance(x, model.W_Object):
raise TypeError, "attempt to wrap already wrapped object: %s"%(x,)
if isinstance(x, OperationError):
raise TypeError, ("attempt to wrap already wrapped exception: %s"%
@@ -272,13 +262,13 @@
return w_result
return None
wrap_exception_cls._annspecialcase_ = "override:wrap_exception_cls"
-
+
def unwrap(self, w_obj):
if isinstance(w_obj, Wrappable):
return w_obj
- if isinstance(w_obj, W_Object):
+ if isinstance(w_obj, model.W_Object):
return w_obj.unwrap(self)
- raise UnwrapError, "cannot unwrap: %r" % w_obj
+ raise model.UnwrapError, "cannot unwrap: %r" % w_obj
def newint(self, intval):
# this time-critical and circular-imports-funny method was stored
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/settype.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/settype.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/settype.py Mon Mar 29 19:31:23 2010
@@ -1,5 +1,5 @@
from pypy.interpreter.error import OperationError
-from pypy.objspace.std.objspace import register_all
+from pypy.objspace.std.register_all import register_all
from pypy.objspace.std.stdtypedef import StdTypeDef, newmethod, no_hash_descr
from pypy.objspace.std.stdtypedef import SMM
from pypy.interpreter.gateway import NoneNotWrapped
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_complexobject.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_complexobject.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_complexobject.py Mon Mar 29 19:31:23 2010
@@ -1,7 +1,7 @@
import py
from pypy.objspace.std import complexobject as cobj
from pypy.objspace.std import complextype as cobjtype
-from pypy.objspace.std.objspace import FailedToImplement
+from pypy.objspace.std.multimethod import FailedToImplement
from pypy.objspace.std.stringobject import W_StringObject
from pypy.objspace.std import StdObjSpace
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_floatobject.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_floatobject.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_floatobject.py Mon Mar 29 19:31:23 2010
@@ -1,5 +1,5 @@
from pypy.objspace.std import floatobject as fobj
-from pypy.objspace.std.objspace import FailedToImplement
+from pypy.objspace.std.multimethod import FailedToImplement
import py
class TestW_FloatObject:
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_intobject.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_intobject.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_intobject.py Mon Mar 29 19:31:23 2010
@@ -1,7 +1,7 @@
import py
import sys
from pypy.objspace.std import intobject as iobj
-from pypy.objspace.std.objspace import FailedToImplement
+from pypy.objspace.std.multimethod import FailedToImplement
from pypy.rlib.rarithmetic import r_uint
from pypy.rlib.rbigint import rbigint
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_longobject.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_longobject.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_longobject.py Mon Mar 29 19:31:23 2010
@@ -1,7 +1,7 @@
import py
import sys
from pypy.objspace.std import longobject as lobj
-from pypy.objspace.std.objspace import FailedToImplement
+from pypy.objspace.std.multimethod import FailedToImplement
from pypy.interpreter.error import OperationError
from pypy.rlib.rarithmetic import r_uint
from pypy.rlib.rbigint import rbigint
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_smallintobject.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_smallintobject.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_smallintobject.py Mon Mar 29 19:31:23 2010
@@ -5,7 +5,7 @@
# py.test.skip("WITHSMALLINT is not enabled")
from pypy.objspace.std.inttype import wrapint
-from pypy.objspace.std.objspace import FailedToImplement
+from pypy.objspace.std.multimethod import FailedToImplement
from pypy.rlib.rarithmetic import r_uint
from pypy.objspace.std.test.test_intobject import AppTestInt
Modified: pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_typeobject.py
==============================================================================
--- pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_typeobject.py (original)
+++ pypy/branch/cleanup-objspace-init/pypy/objspace/std/test/test_typeobject.py Mon Mar 29 19:31:23 2010
@@ -1,5 +1,5 @@
-from pypy.objspace.std.objspace import *
-from pypy.objspace.std.stdtypedef import *
+from pypy.objspace.std.model import W_Object
+from pypy.objspace.std.stdtypedef import StdTypeDef, newmethod
from pypy.conftest import gettestobjspace
from pypy.objspace.std.typeobject import W_TypeObject
More information about the Pypy-commit
mailing list