Alex Gaynor avatar Alex Gaynor committed 26af0e3

finish killing Wrappable

Comments (0)

Files changed (51)

pypy/doc/discussion/improve-rpython.rst

   implement a pypy module. A typical rpython file is likely to contain many
   `import` statements::
 
-    from pypy.interpreter.baseobjspace import Wrappable
+    from pypy.interpreter.baseobjspace import W_Root
     from pypy.interpreter.gateway import ObjSpace, W_Root
     from pypy.interpreter.argument import Arguments
     from pypy.interpreter.typedef import TypeDef, GetSetProperty
 
 - A more direct declarative way to write Typedef::
 
-    class W_Socket(Wrappable):
+    class W_Socket(W_Root):
         _typedef_name_ = 'socket'
         _typedef_base_ = W_EventualBaseClass
 

pypy/doc/interpreter.rst

 ===================================
-Bytecode Interpreter 
+Bytecode Interpreter
 ===================================
 
 .. contents::
 Introduction and Overview
 ===============================
 
-This document describes the implementation of PyPy's 
-Bytecode Interpreter and related Virtual Machine functionalities. 
+This document describes the implementation of PyPy's
+Bytecode Interpreter and related Virtual Machine functionalities.
 
 PyPy's bytecode interpreter has a structure reminiscent of CPython's
 Virtual Machine: It processes code objects parsed and compiled from
 translated with the rest of PyPy.
 
 Code objects contain
-condensed information about their respective functions, class and 
+condensed information about their respective functions, class and
 module body source codes.  Interpreting such code objects means
 instantiating and initializing a `Frame class`_ and then
-calling its ``frame.eval()`` method.  This main entry point 
-initialize appropriate namespaces and then interprets each 
+calling its ``frame.eval()`` method.  This main entry point
+initialize appropriate namespaces and then interprets each
 bytecode instruction.  Python's standard library contains
-the `lib-python/2.7/dis.py`_ module which allows to inspection 
-of the virtual machine's bytecode instructions:: 
+the `lib-python/2.7/dis.py`_ module which allows to inspection
+of the virtual machine's bytecode instructions::
 
     >>> import dis
     >>> def f(x):
     >>> dis.dis(f)
     2         0 LOAD_FAST                0 (x)
               3 LOAD_CONST               1 (1)
-              6 BINARY_ADD          
-              7 RETURN_VALUE        
+              6 BINARY_ADD
+              7 RETURN_VALUE
 
 CPython and PyPy are stack-based virtual machines, i.e.
 they don't have registers but instead push object to and pull objects
 from a stack.  The bytecode interpreter is only responsible
 for implementing control flow and pushing and pulling black
-box objects to and from this value stack.  The bytecode interpreter 
+box objects to and from this value stack.  The bytecode interpreter
 does not know how to perform operations on those black box
 (`wrapped`_) objects for which it delegates to the `object
 space`_.  In order to implement a conditional branch in a program's
 execution, however, it needs to gain minimal knowledge about a
 wrapped object.  Thus, each object space has to offer a
 ``is_true(w_obj)`` operation which returns an
-interpreter-level boolean value.  
+interpreter-level boolean value.
 
 For the understanding of the interpreter's inner workings it
 is crucial to recognize the concepts of `interpreter-level and
 application-level`_ code.  In short, interpreter-level is executed
-directly on the machine and invoking application-level functions 
-leads to an bytecode interpretation indirection. However, 
+directly on the machine and invoking application-level functions
+leads to an bytecode interpretation indirection. However,
 special care must be taken regarding exceptions because
-application level exceptions are wrapped into ``OperationErrors`` 
-which are thus distinguished from plain interpreter-level exceptions. 
+application level exceptions are wrapped into ``OperationErrors``
+which are thus distinguished from plain interpreter-level exceptions.
 See `application level exceptions`_ for some more information
-on ``OperationErrors``. 
+on ``OperationErrors``.
 
 The interpreter implementation offers mechanisms to allow a
-caller to be unaware of whether a particular function invocation 
+caller to be unaware of whether a particular function invocation
 leads to bytecode interpretation or is executed directly at
 interpreter-level.  The two basic kinds of `Gateway classes`_
 expose either an interpreter-level function to
 application-level execution (``interp2app``) or allow
 transparent invocation of application-level helpers
-(``app2interp``) at interpreter-level. 
+(``app2interp``) at interpreter-level.
 
-Another task of the bytecode interpreter is to care for exposing its 
-basic code, frame, module and function objects to application-level 
-code.  Such runtime introspection and modification abilities are 
-implemented via `interpreter descriptors`_ (also see Raymond Hettingers 
-`how-to guide for descriptors`_ in Python, PyPy uses this model extensively). 
+Another task of the bytecode interpreter is to care for exposing its
+basic code, frame, module and function objects to application-level
+code.  Such runtime introspection and modification abilities are
+implemented via `interpreter descriptors`_ (also see Raymond Hettingers
+`how-to guide for descriptors`_ in Python, PyPy uses this model extensively).
 
-A significant complexity lies in `function argument parsing`_.  Python as a 
-language offers flexible ways of providing and receiving arguments 
-for a particular function invocation.  Not only does it take special care 
+A significant complexity lies in `function argument parsing`_.  Python as a
+language offers flexible ways of providing and receiving arguments
+for a particular function invocation.  Not only does it take special care
 to get this right, it also presents difficulties for the `annotation
 pass`_ which performs a whole-program analysis on the
 bytecode interpreter, argument parsing and gatewaying code
 in order to infer the types of all values flowing across function
-calls. 
+calls.
 
 It is for this reason that PyPy resorts to generate
 specialized frame classes and functions at `initialization
-time`_ in order to let the annotator only see rather static 
-program flows with homogeneous name-value assignments on 
-function invocations. 
+time`_ in order to let the annotator only see rather static
+program flows with homogeneous name-value assignments on
+function invocations.
 
 .. _`how-to guide for descriptors`: http://users.rcn.com/python/download/Descriptor.htm
 .. _`annotation pass`: translation.html#the-annotation-pass
 .. _`initialization time`: translation.html#initialization-time
-.. _`interpreter-level and application-level`: coding-guide.html#interpreter-level 
+.. _`interpreter-level and application-level`: coding-guide.html#interpreter-level
 .. _`wrapped`: coding-guide.html#wrapping-rules
 .. _`object space`: objspace.html
 .. _`application level exceptions`: coding-guide.html#applevel-exceptions
 .. _`here`: coding-guide.html#modules
 
 
-Bytecode Interpreter Implementation Classes  
+Bytecode Interpreter Implementation Classes
 ================================================
 
-.. _`Frame class`: 
-.. _`Frame`: 
+.. _`Frame class`:
+.. _`Frame`:
 
 Frame classes
 -----------------
 
-The concept of Frames is pervasive in executing programs and 
+The concept of Frames is pervasive in executing programs and
 on virtual machines in particular. They are sometimes called
 *execution frame* because they hold crucial information
 regarding the execution of a Code_ object, which in turn is
 often directly related to a Python `Function`_.  Frame
-instances hold the following state: 
+instances hold the following state:
 
-- the local scope holding name-value bindings, usually implemented 
+- the local scope holding name-value bindings, usually implemented
   via a "fast scope" which is an array of wrapped objects
 
 - a blockstack containing (nested) information regarding the
-  control flow of a function (such as ``while`` and ``try`` constructs) 
+  control flow of a function (such as ``while`` and ``try`` constructs)
 
 - a value stack where bytecode interpretation pulls object
   from and puts results on.
 
 - a reference to the *globals* dictionary, containing
-  module-level name-value bindings 
+  module-level name-value bindings
 
-- debugging information from which a current line-number and 
-  file location can be constructed for tracebacks 
+- debugging information from which a current line-number and
+  file location can be constructed for tracebacks
 
 Moreover the Frame class itself has a number of methods which implement
 the actual bytecodes found in a code object.  The methods of the ``PyFrame``
 - nested scope support is added to the ``PyFrame`` class in
   `pypy/interpreter/nestedscope.py`_.
 
-.. _Code: 
+.. _Code:
 
-Code Class 
------------- 
+Code Class
+------------
 
-PyPy's code objects contain the same information found in CPython's code objects. 
-They differ from Function_ objects in that they are only immutable representations 
+PyPy's code objects contain the same information found in CPython's code objects.
+They differ from Function_ objects in that they are only immutable representations
 of source code and don't contain execution state or references to the execution
-environment found in `Frames`.  Frames and Functions have references 
+environment found in `Frames`.  Frames and Functions have references
 to a code object. Here is a list of Code attributes:
 
-* ``co_flags`` flags if this code object has nested scopes/generators 
+* ``co_flags`` flags if this code object has nested scopes/generators
 * ``co_stacksize`` the maximum depth the stack can reach while executing the code
-* ``co_code`` the actual bytecode string 
- 
-* ``co_argcount`` number of arguments this code object expects 
+* ``co_code`` the actual bytecode string
+
+* ``co_argcount`` number of arguments this code object expects
 * ``co_varnames`` a tuple of all argument names pass to this code object
-* ``co_nlocals`` number of local variables 
+* ``co_nlocals`` number of local variables
 * ``co_names`` a tuple of all names used in the code object
-* ``co_consts`` a tuple of prebuilt constant objects ("literals") used in the code object 
-* ``co_cellvars`` a tuple of Cells containing values for access from nested scopes 
-* ``co_freevars`` a tuple of Cell names from "above" scopes 
- 
-* ``co_filename`` source file this code object was compiled from 
-* ``co_firstlineno`` the first linenumber of the code object in its source file 
-* ``co_name`` name of the code object (often the function name) 
-* ``co_lnotab`` a helper table to compute the line-numbers corresponding to bytecodes 
+* ``co_consts`` a tuple of prebuilt constant objects ("literals") used in the code object
+* ``co_cellvars`` a tuple of Cells containing values for access from nested scopes
+* ``co_freevars`` a tuple of Cell names from "above" scopes
+
+* ``co_filename`` source file this code object was compiled from
+* ``co_firstlineno`` the first linenumber of the code object in its source file
+* ``co_name`` name of the code object (often the function name)
+* ``co_lnotab`` a helper table to compute the line-numbers corresponding to bytecodes
 
 In PyPy, code objects also have the responsibility of creating their Frame_ objects
 via the `'create_frame()`` method.  With proper parser and compiler support this would
 allow to create custom Frame objects extending the execution of functions
 in various ways.  The several Frame_ classes already utilize this flexibility
-in order to implement Generators and Nested Scopes. 
+in order to implement Generators and Nested Scopes.
 
-.. _Function: 
+.. _Function:
 
 Function and Method classes
 ----------------------------
 
-The PyPy ``Function`` class (in `pypy/interpreter/function.py`_) 
-represents a Python function.  A ``Function`` carries the following 
-main attributes: 
+The PyPy ``Function`` class (in `pypy/interpreter/function.py`_)
+represents a Python function.  A ``Function`` carries the following
+main attributes:
 
-* ``func_doc`` the docstring (or None) 
-* ``func_name`` the name of the function 
-* ``func_code`` the Code_ object representing the function source code 
+* ``func_doc`` the docstring (or None)
+* ``func_name`` the name of the function
+* ``func_code`` the Code_ object representing the function source code
 * ``func_defaults`` default values for the function (built at function definition time)
-* ``func_dict`` dictionary for additional (user-defined) function attributes 
-* ``func_globals`` reference to the globals dictionary 
-* ``func_closure`` a tuple of Cell references  
+* ``func_dict`` dictionary for additional (user-defined) function attributes
+* ``func_globals`` reference to the globals dictionary
+* ``func_closure`` a tuple of Cell references
 
 ``Functions`` classes also provide a ``__get__`` descriptor which creates a Method
 object holding a binding to an instance or a class.  Finally, ``Functions``
-and ``Methods`` both offer a ``call_args()`` method which executes 
-the function given an `Arguments`_ class instance. 
+and ``Methods`` both offer a ``call_args()`` method which executes
+the function given an `Arguments`_ class instance.
 
-.. _Arguments: 
-.. _`function argument parsing`: 
+.. _Arguments:
+.. _`function argument parsing`:
 
-Arguments Class 
--------------------- 
+Arguments Class
+--------------------
 
 The Argument class (in `pypy/interpreter/argument.py`_) is
-responsible for parsing arguments passed to functions.  
+responsible for parsing arguments passed to functions.
 Python has rather complex argument-passing concepts:
 
-- positional arguments 
+- positional arguments
 
-- keyword arguments specified by name 
+- keyword arguments specified by name
 
 - default values for positional arguments, defined at function
-  definition time 
+  definition time
 
 - "star args" allowing a function to accept remaining
-  positional arguments 
+  positional arguments
 
-- "star keyword args" allow a function to accept additional 
-  arbitrary name-value bindings 
+- "star keyword args" allow a function to accept additional
+  arbitrary name-value bindings
 
-Moreover, a Function_ object can get bound to a class or instance 
+Moreover, a Function_ object can get bound to a class or instance
 in which case the first argument to the underlying function becomes
-the bound object.  The ``Arguments`` provides means to allow all 
-this argument parsing and also cares for error reporting. 
+the bound object.  The ``Arguments`` provides means to allow all
+this argument parsing and also cares for error reporting.
 
 
-.. _`Module`: 
+.. _`Module`:
 
-Module Class 
-------------------- 
+Module Class
+-------------------
 
-A ``Module`` instance represents execution state usually constructed 
+A ``Module`` instance represents execution state usually constructed
 from executing the module's source file.  In addition to such a module's
-global ``__dict__`` dictionary it has the following application level 
-attributes: 
+global ``__dict__`` dictionary it has the following application level
+attributes:
 
 * ``__doc__`` the docstring of the module
-* ``__file__`` the source filename from which this module was instantiated 
-* ``__path__`` state used for relative imports 
+* ``__file__`` the source filename from which this module was instantiated
+* ``__path__`` state used for relative imports
 
 Apart from the basic Module used for importing
 application-level files there is a more refined
 level and at interpreter level.  See the ``__builtin__``
 module's `pypy/module/__builtin__/__init__.py`_ file for an
 example and the higher level `chapter on Modules in the coding
-guide`_. 
+guide`_.
 
 .. _`__builtin__ module`: https://bitbucket.org/pypy/pypy/src/tip/pypy/module/__builtin__/
-.. _`chapter on Modules in the coding guide`: coding-guide.html#modules 
+.. _`chapter on Modules in the coding guide`: coding-guide.html#modules
 
-.. _`Gateway classes`: 
+.. _`Gateway classes`:
 
-Gateway classes 
----------------------- 
+Gateway classes
+----------------------
 
 A unique PyPy property is the ability to easily cross the barrier
 between interpreted and machine-level code (often referred to as
-the difference between `interpreter-level and application-level`_). 
-Be aware that the according code (in `pypy/interpreter/gateway.py`_) 
+the difference between `interpreter-level and application-level`_).
+Be aware that the according code (in `pypy/interpreter/gateway.py`_)
 for crossing the barrier in both directions is somewhat
 involved, mostly due to the fact that the type-inferring
 annotator needs to keep track of the types of objects flowing
-across those barriers. 
+across those barriers.
 
 .. _typedefs:
 
 Making interpreter-level functions available at application-level
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-In order to make an interpreter-level function available at 
-application level, one invokes ``pypy.interpreter.gateway.interp2app(func)``. 
-Such a function usually takes a ``space`` argument and any number 
+In order to make an interpreter-level function available at
+application level, one invokes ``pypy.interpreter.gateway.interp2app(func)``.
+Such a function usually takes a ``space`` argument and any number
 of positional arguments. Additionally, such functions can define
 an ``unwrap_spec`` telling the ``interp2app`` logic how
 application-level provided arguments should be unwrapped
-before the actual interpreter-level function is invoked. 
-For example, `interpreter descriptors`_ such as the ``Module.__new__`` 
-method for allocating and constructing a Module instance are 
-defined with such code:: 
+before the actual interpreter-level function is invoked.
+For example, `interpreter descriptors`_ such as the ``Module.__new__``
+method for allocating and constructing a Module instance are
+defined with such code::
 
     Module.typedef = TypeDef("module",
         __new__ = interp2app(Module.descr_module__new__.im_func,
                              unwrap_spec=[ObjSpace, W_Root, Arguments]),
         __init__ = interp2app(Module.descr_module__init__),
                         # module dictionaries are readonly attributes
-        __dict__ = GetSetProperty(descr_get_dict, cls=Module), 
-        __doc__ = 'module(name[, doc])\n\nCreate a module object...' 
+        __dict__ = GetSetProperty(descr_get_dict, cls=Module),
+        __doc__ = 'module(name[, doc])\n\nCreate a module object...'
         )
 
-The actual ``Module.descr_module__new__`` interpreter-level method 
-referenced from the ``__new__`` keyword argument above is defined 
-like this:: 
+The actual ``Module.descr_module__new__`` interpreter-level method
+referenced from the ``__new__`` keyword argument above is defined
+like this::
 
     def descr_module__new__(space, w_subtype, __args__):
         module = space.allocate_instance(Module, w_subtype)
         Module.__init__(module, space, None)
         return space.wrap(module)
 
-Summarizing, the ``interp2app`` mechanism takes care to route 
-an application level access or call to an internal interpreter-level 
+Summarizing, the ``interp2app`` mechanism takes care to route
+an application level access or call to an internal interpreter-level
 object appropriately to the descriptor, providing enough precision
-and hints to keep the type-inferring annotator happy. 
+and hints to keep the type-inferring annotator happy.
 
 
-Calling into application level code from interpreter-level 
+Calling into application level code from interpreter-level
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-Application level code is `often preferable`_. Therefore, 
-we often like to invoke application level code from interpreter-level. 
+Application level code is `often preferable`_. Therefore,
+we often like to invoke application level code from interpreter-level.
 This is done via the Gateway's ``app2interp`` mechanism
-which we usually invoke at definition time in a module. 
-It generates a hook which looks like an interpreter-level 
-function accepting a space and an arbitrary number of arguments. 
-When calling a function at interpreter-level the caller side 
+which we usually invoke at definition time in a module.
+It generates a hook which looks like an interpreter-level
+function accepting a space and an arbitrary number of arguments.
+When calling a function at interpreter-level the caller side
 does usually not need to be aware if its invoked function
 is run through the PyPy interpreter or if it will directly
-execute on the machine (after translation). 
+execute on the machine (after translation).
 
-Here is an example showing how we implement the Metaclass 
+Here is an example showing how we implement the Metaclass
 finding algorithm of the Python language in PyPy::
 
     app = gateway.applevel(r'''
 
     find_metaclass  = app.interphook('find_metaclass')
 
-The ``find_metaclass`` interpreter-level hook is invoked 
+The ``find_metaclass`` interpreter-level hook is invoked
 with five arguments from the ``BUILD_CLASS`` opcode implementation
-in `pypy/interpreter/pyopcode.py`_:: 
+in `pypy/interpreter/pyopcode.py`_::
 
     def BUILD_CLASS(f):
         w_methodsdict = f.valuestack.pop()
                                            w_bases, w_methodsdict)
         f.valuestack.push(w_newclass)
 
-Note that at a later point we can rewrite the ``find_metaclass`` 
-implementation at interpreter-level and we would not have 
-to modify the calling side at all. 
+Note that at a later point we can rewrite the ``find_metaclass``
+implementation at interpreter-level and we would not have
+to modify the calling side at all.
 
 .. _`often preferable`: coding-guide.html#app-preferable
-.. _`interpreter descriptors`: 
+.. _`interpreter descriptors`:
 
-Introspection and Descriptors 
+Introspection and Descriptors
 ------------------------------
 
-Python traditionally has a very far-reaching introspection model 
+Python traditionally has a very far-reaching introspection model
 for bytecode interpreter related objects. In PyPy and in CPython read
-and write accesses to such objects are routed to descriptors. 
+and write accesses to such objects are routed to descriptors.
 Of course, in CPython those are implemented in ``C`` while in
-PyPy they are implemented in interpreter-level Python code. 
+PyPy they are implemented in interpreter-level Python code.
 
 All instances of a Function_, Code_, Frame_ or Module_ classes
-are also ``Wrappable`` instances which means they can be represented 
+are also ``W_Root`` instances which means they can be represented
 at application level.  These days, a PyPy object space needs to
 work with a basic descriptor lookup when it encounters
 accesses to an interpreter-level object:  an object space asks
-a wrapped object for its type via a ``getclass`` method and then 
-calls the type's ``lookup(name)`` function in order to receive a descriptor 
+a wrapped object for its type via a ``getclass`` method and then
+calls the type's ``lookup(name)`` function in order to receive a descriptor
 function.  Most of PyPy's internal object descriptors are defined at the
-end of `pypy/interpreter/typedef.py`_.  You can use these definitions 
-as a reference for the exact attributes of interpreter classes visible 
-at application level. 
+end of `pypy/interpreter/typedef.py`_.  You can use these definitions
+as a reference for the exact attributes of interpreter classes visible
+at application level.
 
 .. include:: _ref.txt

pypy/doc/objspace.rst

 ``wrap(x):``
   Returns a wrapped object that is a reference to the interpreter-level object
   x. This can be used either on simple immutable objects (integers,
-  strings...) to create a new wrapped object, or on instances of ``Wrappable``
+  strings...) to create a new wrapped object, or on instances of ``W_Root``
   to obtain an application-level-visible reference to them.  For example,
-  most classes of the bytecode interpreter subclass ``Wrappable`` and can
+  most classes of the bytecode interpreter subclass ``W_Root`` and can
   be directly exposed to app-level in this way - functions, frames, code
   objects, etc.
 

pypy/interpreter/test/test_gateway.py

         def d(self, w_boo):
             pass
         code = gateway.BuiltinCode(d, unwrap_spec= ['self',
-                                                   gateway.W_Root], self_type=gateway.Wrappable)
+                                                   gateway.W_Root], self_type=gateway.W_Root)
         assert code.signature() == Signature(['self', 'boo'], None, None)
         def e(space, w_x, w_y, __args__):
             pass
                                space.wrap(True))
 
     def test_caching_methods(self):
-        class Base(gateway.Wrappable):
+        class Base(gateway.W_Root):
             def f(self):
                 return 1
 

pypy/interpreter/test/test_typedef.py

 import gc
 from pypy.interpreter import typedef
 from rpython.tool.udir import udir
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import ObjSpace, interp2app
 
 # this test isn't so much to test that the objspace interface *works*
                 cls, len(set), list(set))
 
     def test_getsetproperty(self):
-        class W_SomeType(Wrappable):
+        class W_SomeType(W_Root):
             pass
         def fget(self, space, w_self):
             assert self is prop
         assert self.space.getattr(w_obj, self.space.wrap('x')) is self.space.w_None
 
     def test_getsetproperty_arguments(self):
-        class W_SomeType(Wrappable):
+        class W_SomeType(W_Root):
             def fget1(space, w_self):
                 assert isinstance(space, ObjSpace)
                 assert isinstance(w_self, W_SomeType)
         assert space.getattr(w_obj, space.wrap('x2')) == space.w_None
 
     def test_unhashable(self):
-        class W_SomeType(Wrappable):
+        class W_SomeType(W_Root):
             pass
         W_SomeType.typedef = typedef.TypeDef(
             'some_type',
 
     def test_destructor(self):
         space = self.space
-        class W_Level1(Wrappable):
+        class W_Level1(W_Root):
             def __init__(self, space1):
                 assert space1 is space
             def __del__(self):
                 space.call_method(w_seen, 'append', space.wrap(1))
-        class W_Level2(Wrappable):
+        class W_Level2(W_Root):
             def __init__(self, space1):
                 assert space1 is space
             def __del__(self):
         assert space.unwrap(w_seen) == [6, 2]
 
     def test_multiple_inheritance(self):
-        class W_A(Wrappable):
+        class W_A(W_Root):
             a = 1
             b = 2
         class W_C(W_A):
             a = typedef.interp_attrproperty("a", cls=W_A),
             b = typedef.interp_attrproperty("b", cls=W_A),
         )
-        class W_B(Wrappable):
+        class W_B(W_Root):
             pass
         def standalone_method(space, w_obj):
             if isinstance(w_obj, W_A):
         assert_method(w_o2, "c", False)
 
     def test_total_ordering(self):
-        class W_SomeType(Wrappable):
+        class W_SomeType(W_Root):
             def __init__(self, space, x):
                 self.space = space
                 self.x = x

pypy/module/_cffi_backend/cbuffer.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.buffer import RWBuffer
 from pypy.interpreter.error import operationerrfmt
 from pypy.interpreter.gateway import unwrap_spec, interp2app
             raw_cdata[i] = string[i]
 
 
-class MiniBuffer(Wrappable):
-    # a different subclass of Wrappable for the MiniBuffer, because we
+class MiniBuffer(W_Root):
+    # a different subclass of W_Root for the MiniBuffer, because we
     # want a slightly different (simplified) API at the level of Python.
 
     def __init__(self, buffer, keepalive=None):

pypy/module/_cffi_backend/libraryobj.py

 from __future__ import with_statement
 
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import operationerrfmt
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef
 from pypy.module._cffi_backend.ctypeobj import W_CType
 
 
-class W_Library(Wrappable):
+class W_Library(W_Root):
     _immutable_ = True
     handle = rffi.cast(DLLHANDLE, 0)
 

pypy/module/_collections/app_defaultdict.py

 # For now this is here, living at app-level.
 #
 # The issue is that for now we don't support writing interp-level
-# subclasses of Wrappable that inherit at app-level from a type like
+# subclasses of W_Root that inherit at app-level from a type like
 # 'dict'.  But what we can do is write individual methods at
 # interp-level.
 
 
 
 class defaultdict(dict):
-    
+
     def __init__(self, *args, **kwds):
         if len(args) > 0:
             default_factory = args[0]
             default_factory = None
         self.default_factory = default_factory
         super(defaultdict, self).__init__(*args, **kwds)
- 
+
     def __missing__(self, key):
         pass    # this method is written at interp-level
     __missing__.func_code = _collections.__missing__.func_code
 
     def copy(self):
         return type(self)(self.default_factory, self)
-    
+
     def __copy__(self):
         return self.copy()
 

pypy/module/_continuation/interp_continuation.py

 from rpython.rlib import jit
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.executioncontext import ExecutionContext
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.interpreter.pycode import PyCode
 from pypy.interpreter.pyframe import PyFrame
 
 
-class W_Continulet(Wrappable):
+class W_Continulet(W_Root):
     sthread = None
 
     def __init__(self, space):

pypy/module/_csv/interp_csv.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.typedef import TypeDef, interp_attrproperty
 from pypy.interpreter.typedef import GetSetProperty
 QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE = range(4)
 
 
-class W_Dialect(Wrappable):
+class W_Dialect(W_Root):
     _immutable_fields_ = [
         "dialect",
         "delimiter",
         "quoting",
         "skipinitialspace",
         "strict",
-        ]
+    ]
 
 def _fetch(space, w_dialect, name):
     return space.findattr(w_dialect, space.wrap(name))

pypy/module/_csv/interp_reader.py

 from rpython.rlib.rstring import StringBuilder
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import unwrap_spec
 from pypy.interpreter.typedef import TypeDef, interp2app
  EAT_CRNL) = range(8)
 
 
-class W_Reader(Wrappable):
+class W_Reader(W_Root):
 
     def __init__(self, space, dialect, w_iter):
         self.space = space

pypy/module/_csv/interp_writer.py

 from rpython.rlib.rstring import StringBuilder
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.typedef import TypeDef, interp2app
 from pypy.interpreter.typedef import interp_attrproperty_w
                                          QUOTE_NONNUMERIC, QUOTE_NONE)
 
 
-class W_Writer(Wrappable):
-
+class W_Writer(W_Root):
     def __init__(self, space, dialect, w_fileobj):
         self.space = space
         self.dialect = dialect
         self.w_filewrite = space.getattr(w_fileobj, space.wrap('write'))
         # precompute this
         special = dialect.delimiter + dialect.lineterminator
-        if dialect.escapechar != '\0': special += dialect.escapechar
-        if dialect.quotechar  != '\0': special += dialect.quotechar
+        if dialect.escapechar != '\0':
+            special += dialect.escapechar
+        if dialect.quotechar != '\0':
+            special += dialect.quotechar
         self.special_characters = special
 
     def error(self, msg):

pypy/module/_demo/demo.py

 from pypy.interpreter.error import OperationError
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from rpython.rtyper.lltypesystem import rffi, lltype
                 newlst.append(element)
         lst = newlst
         head += 1
- 
-class W_MyType(Wrappable):
+
+class W_MyType(W_Root):
     def __init__(self, space, x=1):
         self.space = space
         self.x = x

pypy/module/_ffi/interp_funcptr.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError, wrap_oserror, \
     operationerrfmt
 from pypy.interpreter.gateway import interp2app, unwrap_spec
         if space.isinstance_w(w_name, space.w_str):
             name = space.str_w(w_name)
             try:
-                func = CDLL.cdll.getpointer(name, argtypes, restype, 
+                func = CDLL.cdll.getpointer(name, argtypes, restype,
                                             flags = CDLL.flags)
             except KeyError:
                 raise operationerrfmt(
             ordinal = space.int_w(w_name)
             try:
                 func = CDLL.cdll.getpointer_by_ordinal(
-                    ordinal, argtypes, restype, 
+                    ordinal, argtypes, restype,
                     flags = CDLL.flags)
             except KeyError:
                 raise operationerrfmt(
         else:
             raise OperationError(space.w_TypeError, space.wrap(
                     'function name must be a string or integer'))
-else:    
+else:
     @unwrap_spec(name=str)
     def _getfunc(space, CDLL, w_name, w_argtypes, w_restype):
         name = space.str_w(w_name)
         argtypes_w, argtypes, w_restype, restype = unpack_argtypes(
             space, w_argtypes, w_restype)
         try:
-            func = CDLL.cdll.getpointer(name, argtypes, restype, 
+            func = CDLL.cdll.getpointer(name, argtypes, restype,
                                         flags = CDLL.flags)
         except KeyError:
             raise operationerrfmt(
 
 # ========================================================================
 
-class W_FuncPtr(Wrappable):
+class W_FuncPtr(W_Root):
 
     _immutable_fields_ = ['func', 'argtypes_w[*]', 'w_restype']
 
             return rffi.cast(rffi.LONG, call(self.argchain, rffi.SIGNEDCHAR))
         else:
             self.error(w_ffitype)
-            
+
     def get_unsigned(self, w_ffitype):
         return self.func.call(self.argchain, rffi.ULONG)
 
 
     def get_void(self, w_ffitype):
         return self.func.call(self.argchain, lltype.Void)
-    
+
 
 def unpack_argtypes(space, w_argtypes, w_restype):
     argtypes_w = [space.interp_w(W_FFIType, w_argtype)
     return argtypes_w, argtypes, w_restype, restype
 
 @unwrap_spec(addr=r_uint, name=str, flags=int)
-def descr_fromaddr(space, w_cls, addr, name, w_argtypes, 
+def descr_fromaddr(space, w_cls, addr, name, w_argtypes,
                     w_restype, flags=libffi.FUNCFLAG_CDECL):
     argtypes_w, argtypes, w_restype, restype = unpack_argtypes(space,
                                                                w_argtypes,
 
 # ========================================================================
 
-class W_CDLL(Wrappable):
+class W_CDLL(W_Root):
     def __init__(self, space, name, mode):
         self.flags = libffi.FUNCFLAG_CDECL
         self.space = space

pypy/module/_hashlib/interp_hashlib.py

 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.interpreter.error import OperationError
 from rpython.tool.sourcetools import func_renamer
-from pypy.interpreter.baseobjspace import Wrappable
-from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
+from pypy.interpreter.baseobjspace import W_Root
+from rpython.rtyper.lltypesystem import lltype, rffi
 from rpython.rlib import rgc, ropenssl
-from rpython.rlib.objectmodel import keepalive_until_here
 from rpython.rlib.rstring import StringBuilder
 from pypy.module.thread.os_lock import Lock
 
+
 algorithms = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')
 
-class W_Hash(Wrappable):
+
+class W_Hash(W_Root):
     NULL_CTX = lltype.nullptr(ropenssl.EVP_MD_CTX.TO)
     ctx = NULL_CTX
 
     digestsize=GetSetProperty(W_Hash.get_digest_size),
     block_size=GetSetProperty(W_Hash.get_block_size),
     name=GetSetProperty(W_Hash.get_name),
-    )
+)
 W_Hash.acceptable_as_base_class = False
 
 @unwrap_spec(name=str, string='bufferstr')

pypy/module/_lsprof/interp_lsprof.py

 import py
 
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.function import Method, Function
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 else:
     timer_size_int = r_longlong
 
-class W_StatsEntry(Wrappable):
+class W_StatsEntry(W_Root):
     def __init__(self, space, frame, callcount, reccallcount, tt, it,
                  w_sublist):
         self.frame = frame
     __repr__ = interp2app(W_StatsEntry.repr),
 )
 
-class W_StatsSubEntry(Wrappable):
+class W_StatsSubEntry(W_Root):
     def __init__(self, space, frame, callcount, reccallcount, tt, it):
         self.frame = frame
         self.callcount = callcount
         # ignore or raise an exception???
         pass
 
-class W_Profiler(Wrappable):
 
+class W_Profiler(W_Root):
     def __init__(self, space, w_callable, time_unit, subcalls, builtins):
         self.subcalls = subcalls
         self.builtins = builtins

pypy/module/_md5/interp_md5.py

 from rpython.rlib import rmd5
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 
 
-class W_MD5(Wrappable, rmd5.RMD5):
+class W_MD5(W_Root, rmd5.RMD5):
     """
     A subclass of RMD5 that can be exposed to app-level.
     """

pypy/module/_multibytecodec/interp_incremental.py

 from pypy.module._multibytecodec.interp_multibytecodec import (
     MultibyteCodec, wrap_unicodedecodeerror, wrap_runtimeerror,
     wrap_unicodeencodeerror)
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.module._codecs.interp_codecs import CodecState
 
 
-class MultibyteIncrementalBase(Wrappable):
-
+class MultibyteIncrementalBase(W_Root):
     def __init__(self, space, errors):
         if errors is None:
             errors = 'strict'
     reset   = interp2app(MultibyteIncrementalDecoder.reset_w),
     errors  = GetSetProperty(MultibyteIncrementalDecoder.fget_errors,
                              MultibyteIncrementalDecoder.fset_errors),
-    )
+)
 
 
 class MultibyteIncrementalEncoder(MultibyteIncrementalBase):
     reset   = interp2app(MultibyteIncrementalEncoder.reset_w),
     errors  = GetSetProperty(MultibyteIncrementalEncoder.fget_errors,
                              MultibyteIncrementalEncoder.fset_errors),
-    )
+)
 
 
 def get_ignore_error(final):

pypy/module/_multibytecodec/interp_multibytecodec.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.error import OperationError
 from pypy.module._codecs.interp_codecs import CodecState
 
 
-class MultibyteCodec(Wrappable):
-
+class MultibyteCodec(W_Root):
     def __init__(self, name, codec):
         self.name = name
         self.codec = codec

pypy/module/_sha/interp_sha.py

 from rpython.rlib import rsha
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 
 
-class W_SHA(Wrappable, rsha.RSHA):
+class W_SHA(W_Root, rsha.RSHA):
     """
     A subclass of RSHA that can be exposed to app-level.
     """

pypy/module/_socket/interp_socket.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef, make_weakref_descr,\
      interp_attrproperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
     return addr
 
 
-class W_RSocket(Wrappable, RSocket):
+class W_RSocket(W_Root, RSocket):
     def __del__(self):
         self.clear_all_weakrefs()
         RSocket.__del__(self)

pypy/module/_ssl/interp_ssl.py

 from __future__ import with_statement
 from rpython.rtyper.lltypesystem import rffi, lltype
 from pypy.interpreter.error import OperationError
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 
             raise ssl_error(space, msg)
         return space.wrap(bytes)
 
-class SSLObject(Wrappable):
+
+class SSLObject(W_Root):
     def __init__(self, space):
         self.space = space
         self.w_socket = None

pypy/module/_winreg/interp_winreg.py

 from __future__ import with_statement
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.interpreter.error import OperationError, wrap_windowserror
                          space.newtuple([space.wrap(errcode),
                                          space.wrap(message)]))
 
-class W_HKEY(Wrappable):
+class W_HKEY(W_Root):
     def __init__(self, hkey):
         self.hkey = hkey
 

pypy/module/bz2/interp_bz2.py

 from rpython.rtyper.lltypesystem import rffi
 from rpython.rtyper.lltypesystem import lltype
 from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef, interp_attrproperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from rpython.rlib.streamio import Stream
     W_BZ2Compressor.__init__(x, space, compresslevel)
     return space.wrap(x)
 
-class W_BZ2Compressor(Wrappable):
+class W_BZ2Compressor(W_Root):
     """BZ2Compressor([compresslevel=9]) -> compressor object
 
     Create a new compressor object. This object may be used to compress
     W_BZ2Decompressor.__init__(x, space)
     return space.wrap(x)
 
-class W_BZ2Decompressor(Wrappable):
+
+class W_BZ2Decompressor(W_Root):
     """BZ2Decompressor() -> decompressor object
 
     Create a new decompressor object. This object may be used to decompress

pypy/module/cStringIO/interp_stringio.py

 from pypy.interpreter.error import OperationError
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from rpython.rlib.rStringIO import RStringIO
 
 
-class W_InputOutputType(Wrappable):
+class W_InputOutputType(W_Root):
     softspace = 0    # part of the file object API
 
     def descr___iter__(self):

pypy/module/clr/interp_clr.py

 import os.path
 from pypy.module.clr import assemblyname
-from pypy.interpreter.baseobjspace import W_Root, Wrappable
+from pypy.interpreter.baseobjspace import W_Root, W_Root
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.gateway import interp2app, unwrap_spec, ApplevelClass
 from pypy.interpreter.typedef import TypeDef
                          space.wrap(isClassGeneric))
 
 
-class W_CliObject(Wrappable):
+class W_CliObject(W_Root):
     def __init__(self, space, b_obj):
         self.space = space
         self.b_obj = b_obj

pypy/module/cppyy/capi/cint_capi.py

 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from rpython.rtyper.lltypesystem import rffi
     w_klassname = space.call_method(w_branch, "GetClassName")
     klass = interp_cppyy.scope_byname(space, space.str_w(w_klassname))
     w_obj = klass.construct()
-    #space.call_method(w_branch, "SetStatus", space.wrap(1)) 
+    #space.call_method(w_branch, "SetStatus", space.wrap(1))
     activate_branch(space, w_branch)
     space.call_method(w_branch, "SetObject", w_obj)
     space.call_method(w_branch, "GetEntry", space.wrap(0))
     space.setattr(w_self, args_w[0], w_obj)
     return w_obj
 
-class W_TTreeIter(Wrappable):
+class W_TTreeIter(W_Root):
     def __init__(self, space, w_tree):
 
         from pypy.module.cppyy import interp_cppyy
             raise OperationError(self.space.w_StopIteration, self.space.w_None)
         # TODO: check bytes read?
         self.getentry.call(self.tree, [self.space.wrap(self.current)])
-        self.current += 1 
+        self.current += 1
         return self.w_tree
 
 W_TTreeIter.typedef = TypeDef(

pypy/module/cppyy/interp_cppyy.py

 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty, interp_attrproperty
-from pypy.interpreter.baseobjspace import Wrappable, W_Root
+from pypy.interpreter.baseobjspace import W_Root
 
 from rpython.rtyper.lltypesystem import rffi, lltype, llmemory
 
     state.cppclass_registry[cppclass.handle] = w_pycppclass
 
 
-class W_CPPLibrary(Wrappable):
+class W_CPPLibrary(W_Root):
     _immutable_ = True
 
     def __init__(self, space, cdll):
         CPPMethod.call(self, cppthis, args_w)
 
 
-class W_CPPOverload(Wrappable):
+class W_CPPOverload(W_Root):
     """Dispatcher that is actually available at the app-level: it is a
     collection of (possibly) overloaded methods or functions. It calls these
     in order and deals with error handling and reporting."""
 )
 
 
-class W_CPPDataMember(Wrappable):
+class W_CPPDataMember(W_Root):
     _attrs_ = ['space', 'scope', 'converter', 'offset', '_is_static']
     _immutable_fields = ['scope', 'converter', 'offset', '_is_static']
 
 W_CPPDataMember.typedef.acceptable_as_base_class = False
 
 
-class W_CPPScope(Wrappable):
+class W_CPPScope(W_Root):
     _attrs_ = ['space', 'name', 'handle', 'methods', 'datamembers']
     _immutable_fields_ = ['kind', 'name']
 
             dname = capi.c_datamember_name(self, i)
             if dname: alldir.append(self.space.wrap(dname))
         return self.space.newlist(alldir)
-        
+
 
 W_CPPNamespace.typedef = TypeDef(
     'CPPNamespace',
 W_ComplexCPPClass.typedef.acceptable_as_base_class = False
 
 
-class W_CPPTemplateType(Wrappable):
+class W_CPPTemplateType(W_Root):
     _attrs_ = ['space', 'name', 'handle']
     _immutable_fields = ['name', 'handle']
 
 W_CPPTemplateType.typedef.acceptable_as_base_class = False
 
 
-class W_CPPInstance(Wrappable):
+class W_CPPInstance(W_Root):
     _attrs_ = ['space', 'cppclass', '_rawobject', 'isref', 'python_owns']
     _immutable_fields_ = ["cppclass", "isref"]
 

pypy/module/gc/referents.py

 from rpython.rlib import rgc
-from pypy.interpreter.baseobjspace import W_Root, Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import unwrap_spec
 from pypy.interpreter.error import wrap_oserror, OperationError
 from rpython.rlib.objectmodel import we_are_translated
 
 
-class W_GcRef(Wrappable):
+class W_GcRef(W_Root):
     def __init__(self, gcref):
         self.gcref = gcref
 

pypy/module/micronumpy/base.py

 
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from rpython.tool.pairtype import extendabletype
 from pypy.module.micronumpy.support import calc_strides
 from pypy.module.micronumpy.arrayimpl.base import BaseArrayImplementation
 
+
 def issequence_w(space, w_obj):
     return (space.isinstance_w(w_obj, space.w_tuple) or
             space.isinstance_w(w_obj, space.w_list) or
             isinstance(w_obj, W_NDimArray))
 
+
 class ArrayArgumentException(Exception):
     pass
 
-class W_NDimArray(Wrappable):
+
+class W_NDimArray(W_Root):
     __metaclass__ = extendabletype
 
     def __init__(self, implementation):
         assert isinstance(implementation, BaseArrayImplementation)
         self.implementation = implementation
-    
+
     @staticmethod
     def from_shape(shape, dtype, order='C'):
         from pypy.module.micronumpy.arrayimpl import concrete, scalar
-        
+
         if not shape:
             impl = scalar.Scalar(dtype)
         else:
                                                backstrides, storage)
         return W_NDimArray(impl)
 
-
     @staticmethod
     def new_slice(offset, strides, backstrides, shape, parent, orig_arr, dtype=None):
         from pypy.module.micronumpy.arrayimpl import concrete
             w_val = dtype.coerce(space, w_val)
         return W_NDimArray(scalar.Scalar(dtype, w_val))
 
+
 def convert_to_array(space, w_obj):
     from pypy.module.micronumpy.interp_numarray import array
     from pypy.module.micronumpy import interp_ufuncs
-    
+
     if isinstance(w_obj, W_NDimArray):
         return w_obj
     elif issequence_w(space, w_obj):

pypy/module/micronumpy/interp_boxes.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import operationerrfmt, OperationError
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
     def convert_imag_to(self, dtype):
         return dtype.box(self.imag)
 
-class W_GenericBox(Wrappable):
+
+class W_GenericBox(W_Root):
     _attrs_ = ()
 
     def descr__new__(space, w_subtype, __args__):

pypy/module/micronumpy/interp_dtype.py

 
 import sys
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import (TypeDef, GetSetProperty,
     out = base.W_NDimArray.from_shape(shape, dtype)
     return out
 
-class W_Dtype(Wrappable):
+
+class W_Dtype(W_Root):
     _immutable_fields_ = ["itemtype", "num", "kind"]
 
     def __init__(self, itemtype, num, kind, name, char, w_box_type,

pypy/module/micronumpy/interp_ufuncs.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty, interp_attrproperty
 def done_if_false(dtype, val):
     return not dtype.itemtype.bool(val)
 
-class W_Ufunc(Wrappable):
+class W_Ufunc(W_Root):
     _attrs_ = ["name", "promote_to_float", "promote_bools", "identity",
                "allow_complex", "complex_to_float"]
     _immutable_fields_ = ["promote_to_float", "promote_bools", "name",

pypy/module/mmap/interp_mmap.py

 from pypy.interpreter.error import OperationError, wrap_oserror
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from rpython.rlib import rmmap, rarithmetic
     OFF_T = int
 
 
-class W_MMap(Wrappable):
+class W_MMap(W_Root):
     def __init__(self, space, mmap_obj):
         self.space = space
         self.mmap = mmap_obj

pypy/module/oracle/interp_connect.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import unwrap_spec
 from pypy.interpreter.typedef import (TypeDef, interp_attrproperty_w,
                                       GetSetProperty)
 from pypy.module.oracle.interp_pool import W_SessionPool
 from pypy.module.oracle.interp_variable import VT_String
 
-class W_Connection(Wrappable):
+
+class W_Connection(W_Root):
     def __init__(self):
         self.commitMode = roci.OCI_DEFAULT
         self.environment = None

pypy/module/oracle/interp_cursor.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.interpreter.typedef import interp_attrproperty, interp_attrproperty_w
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 # XXX are those "assert isinstance(xxx, interp_variable.W_Variable)" necessary?
 # the bindList should annotate to SomeList(SomeInstance(W_Variable))
 
-class W_Cursor(Wrappable):
+class W_Cursor(W_Root):
     def __init__(self, space, connection):
         self.connection = connection
         self.environment = connection.environment

pypy/module/oracle/interp_error.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from rpython.rtyper.lltypesystem import rffi, lltype
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.typedef import interp_attrproperty, interp_attrproperty_w
                      datetime.datetime, datetime.date, datetime.timedelta)
         """))
 
-def get(space): 
-    return space.fromcache(State) 
+def get(space):
+    return space.fromcache(State)
 
-class W_Error(Wrappable):
+class W_Error(W_Root):
     def __init__(self, space, environment, context, retrieveError):
         self.context = context
         if retrieveError:

pypy/module/oracle/interp_lob.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.error import OperationError
 
 from pypy.module.oracle.interp_error import get
 
-class W_ExternalLob(Wrappable):
+
+class W_ExternalLob(W_Root):
     def __init__(self, var, pos):
         self.lobVar = var
         self.pos = pos

pypy/module/oracle/interp_object.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.interpreter.typedef import interp_attrproperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.module.oracle import roci, config, transform
 from pypy.module.oracle.interp_error import get
 
-class W_ObjectType(Wrappable):
+class W_ObjectType(W_Root):
     def __init__(self, connection, param):
         self.tdo = lltype.nullptr(roci.dvoidp.TO)
         self.environment = connection.environment
     attributes = GetSetProperty(W_ObjectType.get_attributes),
     )
 
-class W_ObjectAttribute(Wrappable):
+class W_ObjectAttribute(W_Root):
     def __init__(self, connection, param):
         self.initialize(connection, param)
 
     name = interp_attrproperty('name', W_ObjectAttribute),
     )
 
-class W_ExternalObject(Wrappable):
+class W_ExternalObject(W_Root):
     def __init__(self, var, objectType, instance, indicator,
                  isIndependent=True):
         self.var = var # keepalive

pypy/module/oracle/interp_pool.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.argument import Arguments
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.module.oracle import interp_error, interp_environ
 from pypy.module.oracle.interp_error import get
 
-class W_SessionPool(Wrappable):
+
+class W_SessionPool(W_Root):
     def __init__(self):
         self.environment = None
 

pypy/module/oracle/interp_variable.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.typedef import interp_attrproperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec
     return var
 
 
-class W_Variable(Wrappable):
+class W_Variable(W_Root):
     charsetForm = roci.SQLCS_IMPLICIT
     isVariableLength = False
     canBeInArray = True

pypy/module/parser/pyparser.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.error import OperationError
 from rpython.rlib.objectmodel import specialize
 
 
-class STType(Wrappable):
-
+class STType(W_Root):
     def __init__(self, tree, mode):
         self.tree = tree
         self.mode = mode

pypy/module/pyexpat/interp_pyexpat.py

-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.interpreter.error import OperationError
 
 global_storage = Storage()
 
-class CallbackData(Wrappable):
+class CallbackData(W_Root):
     def __init__(self, space, parser):
         self.space = space
         self.parser = weakref.ref(parser)
     def __init__(self, space):
         self.w_error = space.new_exception_class("pyexpat.ExpatError")
 
-class W_XMLParserType(Wrappable):
 
+class W_XMLParserType(W_Root):
     def __init__(self, space, parser, w_intern):
         self.itself = parser
 

pypy/module/pypyjit/interp_resop.py

 
 from pypy.interpreter.typedef import (TypeDef, GetSetProperty,
      interp_attrproperty, interp_attrproperty_w)
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import unwrap_spec, interp2app
 from pypy.interpreter.pycode import PyCode
 from pypy.interpreter.error import OperationError
                                  logops.repr_of_resop(op)))
     return l_w
 
-class WrappedBox(Wrappable):
+
+class WrappedBox(W_Root):
     """ A class representing a single box
     """
     def __init__(self, llbox):
                            jit_hooks.resop_new(num, args, jit_hooks.emptyval()),
                            repr, jd_name, call_depth, call_id, w_greenkey)
 
-class WrappedOp(Wrappable):
+
+class WrappedOp(W_Root):
     """ A class representing a single ResOperation, wrapped nicely
     """
     def __init__(self, op, offset, repr_of_resop):
     """ A class representing Debug Merge Point - the entry point
     to a jitted loop.
     """
-    
+
     def __init__(self, space, op, repr_of_resop, jd_name, call_depth, call_id,
         w_greenkey):
 
 )
 DebugMergePoint.acceptable_as_base_class = False
 
-class W_JitLoopInfo(Wrappable):
+
+class W_JitLoopInfo(W_Root):
     """ Loop debug information
     """
-    
+
     w_green_key = None
     bridge_no   = 0
     asmaddr     = 0
     asmlen      = 0
-    
+
     def __init__(self, space, debug_info, is_bridge=False):
         logops = debug_info.logger._make_log_operations()
         if debug_info.asminfo is not None:
             ofs = {}
         self.w_ops = space.newlist(
             wrap_oplist(space, logops, debug_info.operations, ofs))
-        
+
         self.jd_name = debug_info.get_jitdriver().name
         self.type = debug_info.type
         if is_bridge:
 )
 W_JitLoopInfo.acceptable_as_base_class = False
 
-class W_JitInfoSnapshot(Wrappable):
+
+class W_JitInfoSnapshot(W_Root):
     def __init__(self, space, w_times, w_counters, w_counter_times):
         self.w_loop_run_times = w_times
         self.w_counters = w_counters

pypy/module/select/interp_epoll.py

 
 import errno
 
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.error import OperationError, operationerrfmt, exception_from_errno
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 )
 
 
-class W_Epoll(Wrappable):
+class W_Epoll(W_Root):
     def __init__(self, space, epfd):
         self.epfd = epfd
 

pypy/module/select/interp_select.py

 from pypy.interpreter.typedef import TypeDef
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.interpreter.error import OperationError, wrap_oserror
 from rpython.rlib import rpoll
 unregistering file descriptors, and then polling them for I/O events."""
     return Poll()
 
-class Poll(Wrappable):
+class Poll(W_Root):
     def __init__(self):
         self.fddict = {}
 

pypy/module/thread/os_local.py

 import weakref
 from rpython.rlib import jit
-from pypy.interpreter.baseobjspace import Wrappable, W_Root
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.executioncontext import ExecutionContext
 from pypy.interpreter.typedef import (TypeDef, interp2app, GetSetProperty,
     descr_get_dict)
 from rpython.rlib.rshrinklist import AbstractShrinkList
 
+
 class WRefShrinkList(AbstractShrinkList):
     def must_keep(self, wref):
         return wref() is not None
 ExecutionContext._thread_local_objs = None
 
 
-class Local(Wrappable):
+class Local(W_Root):
     """Thread-local data"""
 
     @jit.dont_look_inside

pypy/module/thread/os_lock.py

 
 from rpython.rlib import rthread
 from pypy.module.thread.error import wrap_thread_error
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef
 
 ##    sys.stderr.write(msg)
 
 
-class Lock(Wrappable):
-    "A wrappable box around an interp-level lock object."
+class Lock(W_Root):
+    "A box around an interp-level lock object."
 
     def __init__(self, space):
         self.space = space

pypy/module/zipimport/interp_zipimport.py

 
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 def get_error(space):
     return space.fromcache(Cache).w_error
 
-class W_ZipCache(Wrappable):
+class W_ZipCache(W_Root):
     def __init__(self):
         self.cache = {}
 
 
 zip_cache = W_ZipCache()
 
-class W_ZipImporter(Wrappable):
+class W_ZipImporter(W_Root):
     def __init__(self, space, name, filename, zip_file, prefix):
         self.space = space
         self.name = name
     def getprefix(self, space):
         if ZIPSEP == os.path.sep:
             return space.wrap(self.prefix)
-        return space.wrap(self.prefix.replace(ZIPSEP, os.path.sep))    
+        return space.wrap(self.prefix.replace(ZIPSEP, os.path.sep))
 
     def _find_relative_path(self, filename):
         if filename.startswith(self.filename):
     archive     = GetSetProperty(W_ZipImporter.getarchive),
     prefix      = GetSetProperty(W_ZipImporter.getprefix),
 )
-

pypy/module/zlib/interp_zlib.py

 import sys
 from pypy.interpreter.gateway import interp2app, unwrap_spec
-from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef, interp_attrproperty
 from pypy.interpreter.error import OperationError
 from rpython.rlib.rarithmetic import intmask, r_uint
     return space.wrap(result)
 
 
-class ZLibObject(Wrappable):
+class ZLibObject(W_Root):
     """
     Common base class for Compress and Decompress.
     """

pypy/objspace/fake/test/test_objspace.py

 from pypy.objspace.fake.objspace import FakeObjSpace, W_Root
 from pypy.interpreter.argument import Arguments
 from pypy.interpreter.typedef import TypeDef
-from pypy.interpreter.baseobjspace import Wrappable
 from rpython.rlib.unroll import unrolling_iterable
 
+
 def test_create():
     FakeObjSpace()
 
 
     def test_gettypefor(self):
         space = self.space
-        class W_Foo(Wrappable):
+
+        class W_Foo(W_Root):
             typedef = TypeDef("foo")
         space.translates(lambda: space.gettypefor(W_Foo))
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.