[pypy-commit] pypy remove-list-smm: finish killing Wrappable
alex_gaynor
noreply at buildbot.pypy.org
Wed Mar 20 23:56:54 CET 2013
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: remove-list-smm
Changeset: r62592:26af0e3ce5d3
Date: 2013-03-20 15:56 -0700
http://bitbucket.org/pypy/pypy/changeset/26af0e3ce5d3/
Log: finish killing Wrappable
diff --git a/pypy/doc/discussion/improve-rpython.rst b/pypy/doc/discussion/improve-rpython.rst
--- a/pypy/doc/discussion/improve-rpython.rst
+++ b/pypy/doc/discussion/improve-rpython.rst
@@ -8,7 +8,7 @@
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
@@ -19,7 +19,7 @@
- A more direct declarative way to write Typedef::
- class W_Socket(Wrappable):
+ class W_Socket(W_Root):
_typedef_name_ = 'socket'
_typedef_base_ = W_EventualBaseClass
diff --git a/pypy/doc/interpreter.rst b/pypy/doc/interpreter.rst
--- a/pypy/doc/interpreter.rst
+++ b/pypy/doc/interpreter.rst
@@ -1,5 +1,5 @@
===================================
-Bytecode Interpreter
+Bytecode Interpreter
===================================
.. contents::
@@ -9,8 +9,8 @@
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
@@ -32,14 +32,14 @@
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):
@@ -47,103 +47,103 @@
>>> 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``
@@ -156,104 +156,104 @@
- 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
@@ -262,80 +262,80 @@
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'''
@@ -359,9 +359,9 @@
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()
@@ -374,32 +374,32 @@
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
diff --git a/pypy/doc/objspace.rst b/pypy/doc/objspace.rst
--- a/pypy/doc/objspace.rst
+++ b/pypy/doc/objspace.rst
@@ -175,9 +175,9 @@
``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.
diff --git a/pypy/interpreter/test/test_gateway.py b/pypy/interpreter/test/test_gateway.py
--- a/pypy/interpreter/test/test_gateway.py
+++ b/pypy/interpreter/test/test_gateway.py
@@ -25,7 +25,7 @@
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
@@ -167,7 +167,7 @@
space.wrap(True))
def test_caching_methods(self):
- class Base(gateway.Wrappable):
+ class Base(gateway.W_Root):
def f(self):
return 1
diff --git a/pypy/interpreter/test/test_typedef.py b/pypy/interpreter/test/test_typedef.py
--- a/pypy/interpreter/test/test_typedef.py
+++ b/pypy/interpreter/test/test_typedef.py
@@ -1,7 +1,7 @@
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*
@@ -139,7 +139,7 @@
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
@@ -151,7 +151,7 @@
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)
@@ -169,7 +169,7 @@
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',
@@ -183,12 +183,12 @@
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):
@@ -261,7 +261,7 @@
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):
@@ -270,7 +270,7 @@
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):
@@ -305,7 +305,7 @@
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
diff --git a/pypy/module/_cffi_backend/cbuffer.py b/pypy/module/_cffi_backend/cbuffer.py
--- a/pypy/module/_cffi_backend/cbuffer.py
+++ b/pypy/module/_cffi_backend/cbuffer.py
@@ -1,4 +1,4 @@
-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
@@ -38,8 +38,8 @@
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):
diff --git a/pypy/module/_cffi_backend/libraryobj.py b/pypy/module/_cffi_backend/libraryobj.py
--- a/pypy/module/_cffi_backend/libraryobj.py
+++ b/pypy/module/_cffi_backend/libraryobj.py
@@ -1,6 +1,6 @@
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
@@ -12,7 +12,7 @@
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)
diff --git a/pypy/module/_collections/app_defaultdict.py b/pypy/module/_collections/app_defaultdict.py
--- a/pypy/module/_collections/app_defaultdict.py
+++ b/pypy/module/_collections/app_defaultdict.py
@@ -3,7 +3,7 @@
# 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.
@@ -11,7 +11,7 @@
class defaultdict(dict):
-
+
def __init__(self, *args, **kwds):
if len(args) > 0:
default_factory = args[0]
@@ -22,7 +22,7 @@
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
@@ -39,7 +39,7 @@
def copy(self):
return type(self)(self.default_factory, self)
-
+
def __copy__(self):
return self.copy()
diff --git a/pypy/module/_continuation/interp_continuation.py b/pypy/module/_continuation/interp_continuation.py
--- a/pypy/module/_continuation/interp_continuation.py
+++ b/pypy/module/_continuation/interp_continuation.py
@@ -2,14 +2,14 @@
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):
diff --git a/pypy/module/_csv/interp_csv.py b/pypy/module/_csv/interp_csv.py
--- a/pypy/module/_csv/interp_csv.py
+++ b/pypy/module/_csv/interp_csv.py
@@ -1,4 +1,4 @@
-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
@@ -8,7 +8,7 @@
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE = range(4)
-class W_Dialect(Wrappable):
+class W_Dialect(W_Root):
_immutable_fields_ = [
"dialect",
"delimiter",
@@ -19,7 +19,7 @@
"quoting",
"skipinitialspace",
"strict",
- ]
+ ]
def _fetch(space, w_dialect, name):
return space.findattr(w_dialect, space.wrap(name))
diff --git a/pypy/module/_csv/interp_reader.py b/pypy/module/_csv/interp_reader.py
--- a/pypy/module/_csv/interp_reader.py
+++ b/pypy/module/_csv/interp_reader.py
@@ -1,5 +1,5 @@
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
@@ -13,7 +13,7 @@
EAT_CRNL) = range(8)
-class W_Reader(Wrappable):
+class W_Reader(W_Root):
def __init__(self, space, dialect, w_iter):
self.space = space
diff --git a/pypy/module/_csv/interp_writer.py b/pypy/module/_csv/interp_writer.py
--- a/pypy/module/_csv/interp_writer.py
+++ b/pypy/module/_csv/interp_writer.py
@@ -1,5 +1,5 @@
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
@@ -8,16 +8,17 @@
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):
diff --git a/pypy/module/_demo/demo.py b/pypy/module/_demo/demo.py
--- a/pypy/module/_demo/demo.py
+++ b/pypy/module/_demo/demo.py
@@ -1,5 +1,5 @@
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
@@ -47,8 +47,8 @@
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
diff --git a/pypy/module/_ffi/interp_funcptr.py b/pypy/module/_ffi/interp_funcptr.py
--- a/pypy/module/_ffi/interp_funcptr.py
+++ b/pypy/module/_ffi/interp_funcptr.py
@@ -1,4 +1,4 @@
-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
@@ -24,7 +24,7 @@
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(
@@ -38,7 +38,7 @@
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(
@@ -51,14 +51,14 @@
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(
@@ -79,7 +79,7 @@
# ========================================================================
-class W_FuncPtr(Wrappable):
+class W_FuncPtr(W_Root):
_immutable_fields_ = ['func', 'argtypes_w[*]', 'w_restype']
@@ -229,7 +229,7 @@
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)
@@ -276,7 +276,7 @@
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)
@@ -288,7 +288,7 @@
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,
@@ -313,7 +313,7 @@
# ========================================================================
-class W_CDLL(Wrappable):
+class W_CDLL(W_Root):
def __init__(self, space, name, mode):
self.flags = libffi.FUNCFLAG_CDECL
self.space = space
diff --git a/pypy/module/_hashlib/interp_hashlib.py b/pypy/module/_hashlib/interp_hashlib.py
--- a/pypy/module/_hashlib/interp_hashlib.py
+++ b/pypy/module/_hashlib/interp_hashlib.py
@@ -3,16 +3,17 @@
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
@@ -116,7 +117,7 @@
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')
diff --git a/pypy/module/_lsprof/interp_lsprof.py b/pypy/module/_lsprof/interp_lsprof.py
--- a/pypy/module/_lsprof/interp_lsprof.py
+++ b/pypy/module/_lsprof/interp_lsprof.py
@@ -1,6 +1,6 @@
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
@@ -35,7 +35,7 @@
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
@@ -72,7 +72,7 @@
__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
@@ -252,8 +252,8 @@
# 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
diff --git a/pypy/module/_md5/interp_md5.py b/pypy/module/_md5/interp_md5.py
--- a/pypy/module/_md5/interp_md5.py
+++ b/pypy/module/_md5/interp_md5.py
@@ -1,10 +1,10 @@
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.
"""
diff --git a/pypy/module/_multibytecodec/interp_incremental.py b/pypy/module/_multibytecodec/interp_incremental.py
--- a/pypy/module/_multibytecodec/interp_incremental.py
+++ b/pypy/module/_multibytecodec/interp_incremental.py
@@ -3,14 +3,13 @@
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'
@@ -82,7 +81,7 @@
reset = interp2app(MultibyteIncrementalDecoder.reset_w),
errors = GetSetProperty(MultibyteIncrementalDecoder.fget_errors,
MultibyteIncrementalDecoder.fset_errors),
- )
+)
class MultibyteIncrementalEncoder(MultibyteIncrementalBase):
@@ -131,7 +130,7 @@
reset = interp2app(MultibyteIncrementalEncoder.reset_w),
errors = GetSetProperty(MultibyteIncrementalEncoder.fget_errors,
MultibyteIncrementalEncoder.fset_errors),
- )
+)
def get_ignore_error(final):
diff --git a/pypy/module/_multibytecodec/interp_multibytecodec.py b/pypy/module/_multibytecodec/interp_multibytecodec.py
--- a/pypy/module/_multibytecodec/interp_multibytecodec.py
+++ b/pypy/module/_multibytecodec/interp_multibytecodec.py
@@ -1,4 +1,4 @@
-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
@@ -6,8 +6,7 @@
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
diff --git a/pypy/module/_sha/interp_sha.py b/pypy/module/_sha/interp_sha.py
--- a/pypy/module/_sha/interp_sha.py
+++ b/pypy/module/_sha/interp_sha.py
@@ -1,10 +1,10 @@
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.
"""
diff --git a/pypy/module/_socket/interp_socket.py b/pypy/module/_socket/interp_socket.py
--- a/pypy/module/_socket/interp_socket.py
+++ b/pypy/module/_socket/interp_socket.py
@@ -1,4 +1,4 @@
-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
@@ -131,7 +131,7 @@
return addr
-class W_RSocket(Wrappable, RSocket):
+class W_RSocket(W_Root, RSocket):
def __del__(self):
self.clear_all_weakrefs()
RSocket.__del__(self)
diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py
--- a/pypy/module/_ssl/interp_ssl.py
+++ b/pypy/module/_ssl/interp_ssl.py
@@ -1,7 +1,7 @@
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
@@ -119,7 +119,8 @@
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
diff --git a/pypy/module/_winreg/interp_winreg.py b/pypy/module/_winreg/interp_winreg.py
--- a/pypy/module/_winreg/interp_winreg.py
+++ b/pypy/module/_winreg/interp_winreg.py
@@ -1,5 +1,5 @@
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
@@ -13,7 +13,7 @@
space.newtuple([space.wrap(errcode),
space.wrap(message)]))
-class W_HKEY(Wrappable):
+class W_HKEY(W_Root):
def __init__(self, hkey):
self.hkey = hkey
diff --git a/pypy/module/bz2/interp_bz2.py b/pypy/module/bz2/interp_bz2.py
--- a/pypy/module/bz2/interp_bz2.py
+++ b/pypy/module/bz2/interp_bz2.py
@@ -3,7 +3,7 @@
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
@@ -512,7 +512,7 @@
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
@@ -616,7 +616,8 @@
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
diff --git a/pypy/module/cStringIO/interp_stringio.py b/pypy/module/cStringIO/interp_stringio.py
--- a/pypy/module/cStringIO/interp_stringio.py
+++ b/pypy/module/cStringIO/interp_stringio.py
@@ -1,11 +1,11 @@
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):
diff --git a/pypy/module/clr/interp_clr.py b/pypy/module/clr/interp_clr.py
--- a/pypy/module/clr/interp_clr.py
+++ b/pypy/module/clr/interp_clr.py
@@ -1,6 +1,6 @@
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
@@ -327,7 +327,7 @@
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
diff --git a/pypy/module/cppyy/capi/cint_capi.py b/pypy/module/cppyy/capi/cint_capi.py
--- a/pypy/module/cppyy/capi/cint_capi.py
+++ b/pypy/module/cppyy/capi/cint_capi.py
@@ -3,7 +3,7 @@
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
@@ -169,14 +169,14 @@
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
@@ -199,7 +199,7 @@
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(
diff --git a/pypy/module/cppyy/interp_cppyy.py b/pypy/module/cppyy/interp_cppyy.py
--- a/pypy/module/cppyy/interp_cppyy.py
+++ b/pypy/module/cppyy/interp_cppyy.py
@@ -3,7 +3,7 @@
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
@@ -99,7 +99,7 @@
state.cppclass_registry[cppclass.handle] = w_pycppclass
-class W_CPPLibrary(Wrappable):
+class W_CPPLibrary(W_Root):
_immutable_ = True
def __init__(self, space, cdll):
@@ -412,7 +412,7 @@
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."""
@@ -495,7 +495,7 @@
)
-class W_CPPDataMember(Wrappable):
+class W_CPPDataMember(W_Root):
_attrs_ = ['space', 'scope', 'converter', 'offset', '_is_static']
_immutable_fields = ['scope', 'converter', 'offset', '_is_static']
@@ -543,7 +543,7 @@
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']
@@ -715,7 +715,7 @@
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',
@@ -836,7 +836,7 @@
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']
@@ -859,7 +859,7 @@
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"]
diff --git a/pypy/module/gc/referents.py b/pypy/module/gc/referents.py
--- a/pypy/module/gc/referents.py
+++ b/pypy/module/gc/referents.py
@@ -1,12 +1,12 @@
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
diff --git a/pypy/module/micronumpy/base.py b/pypy/module/micronumpy/base.py
--- a/pypy/module/micronumpy/base.py
+++ b/pypy/module/micronumpy/base.py
@@ -1,28 +1,31 @@
-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:
@@ -40,7 +43,6 @@
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
@@ -57,10 +59,11 @@
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):
diff --git a/pypy/module/micronumpy/interp_boxes.py b/pypy/module/micronumpy/interp_boxes.py
--- a/pypy/module/micronumpy/interp_boxes.py
+++ b/pypy/module/micronumpy/interp_boxes.py
@@ -1,4 +1,4 @@
-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
@@ -64,7 +64,8 @@
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__):
diff --git a/pypy/module/micronumpy/interp_dtype.py b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -1,6 +1,6 @@
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,
@@ -44,7 +44,8 @@
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,
diff --git a/pypy/module/micronumpy/interp_ufuncs.py b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -1,4 +1,4 @@
-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
@@ -16,7 +16,7 @@
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",
diff --git a/pypy/module/mmap/interp_mmap.py b/pypy/module/mmap/interp_mmap.py
--- a/pypy/module/mmap/interp_mmap.py
+++ b/pypy/module/mmap/interp_mmap.py
@@ -1,5 +1,5 @@
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
@@ -11,7 +11,7 @@
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
diff --git a/pypy/module/oracle/interp_connect.py b/pypy/module/oracle/interp_connect.py
--- a/pypy/module/oracle/interp_connect.py
+++ b/pypy/module/oracle/interp_connect.py
@@ -1,4 +1,4 @@
-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)
@@ -13,7 +13,8 @@
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
diff --git a/pypy/module/oracle/interp_cursor.py b/pypy/module/oracle/interp_cursor.py
--- a/pypy/module/oracle/interp_cursor.py
+++ b/pypy/module/oracle/interp_cursor.py
@@ -1,4 +1,4 @@
-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
@@ -13,7 +13,7 @@
# 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
diff --git a/pypy/module/oracle/interp_error.py b/pypy/module/oracle/interp_error.py
--- a/pypy/module/oracle/interp_error.py
+++ b/pypy/module/oracle/interp_error.py
@@ -1,4 +1,4 @@
-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
@@ -45,10 +45,10 @@
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:
diff --git a/pypy/module/oracle/interp_lob.py b/pypy/module/oracle/interp_lob.py
--- a/pypy/module/oracle/interp_lob.py
+++ b/pypy/module/oracle/interp_lob.py
@@ -1,11 +1,12 @@
-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
diff --git a/pypy/module/oracle/interp_object.py b/pypy/module/oracle/interp_object.py
--- a/pypy/module/oracle/interp_object.py
+++ b/pypy/module/oracle/interp_object.py
@@ -1,4 +1,4 @@
-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
@@ -8,7 +8,7 @@
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
@@ -287,7 +287,7 @@
attributes = GetSetProperty(W_ObjectType.get_attributes),
)
-class W_ObjectAttribute(Wrappable):
+class W_ObjectAttribute(W_Root):
def __init__(self, connection, param):
self.initialize(connection, param)
@@ -340,7 +340,7 @@
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
diff --git a/pypy/module/oracle/interp_pool.py b/pypy/module/oracle/interp_pool.py
--- a/pypy/module/oracle/interp_pool.py
+++ b/pypy/module/oracle/interp_pool.py
@@ -1,4 +1,4 @@
-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
@@ -11,7 +11,8 @@
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
diff --git a/pypy/module/oracle/interp_variable.py b/pypy/module/oracle/interp_variable.py
--- a/pypy/module/oracle/interp_variable.py
+++ b/pypy/module/oracle/interp_variable.py
@@ -1,4 +1,4 @@
-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
@@ -116,7 +116,7 @@
return var
-class W_Variable(Wrappable):
+class W_Variable(W_Root):
charsetForm = roci.SQLCS_IMPLICIT
isVariableLength = False
canBeInArray = True
diff --git a/pypy/module/parser/pyparser.py b/pypy/module/parser/pyparser.py
--- a/pypy/module/parser/pyparser.py
+++ b/pypy/module/parser/pyparser.py
@@ -1,4 +1,4 @@
-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
@@ -8,8 +8,7 @@
from rpython.rlib.objectmodel import specialize
-class STType(Wrappable):
-
+class STType(W_Root):
def __init__(self, tree, mode):
self.tree = tree
self.mode = mode
diff --git a/pypy/module/pyexpat/interp_pyexpat.py b/pypy/module/pyexpat/interp_pyexpat.py
--- a/pypy/module/pyexpat/interp_pyexpat.py
+++ b/pypy/module/pyexpat/interp_pyexpat.py
@@ -1,4 +1,4 @@
-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
@@ -212,7 +212,7 @@
global_storage = Storage()
-class CallbackData(Wrappable):
+class CallbackData(W_Root):
def __init__(self, space, parser):
self.space = space
self.parser = weakref.ref(parser)
@@ -414,8 +414,8 @@
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
diff --git a/pypy/module/pypyjit/interp_resop.py b/pypy/module/pypyjit/interp_resop.py
--- a/pypy/module/pypyjit/interp_resop.py
+++ b/pypy/module/pypyjit/interp_resop.py
@@ -1,7 +1,7 @@
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
@@ -114,7 +114,8 @@
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):
@@ -155,7 +156,8 @@
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):
@@ -191,7 +193,7 @@
""" 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):
@@ -249,15 +251,16 @@
)
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:
@@ -266,7 +269,7 @@
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:
@@ -337,7 +340,8 @@
)
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
diff --git a/pypy/module/select/interp_epoll.py b/pypy/module/select/interp_epoll.py
--- a/pypy/module/select/interp_epoll.py
+++ b/pypy/module/select/interp_epoll.py
@@ -2,7 +2,7 @@
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
@@ -69,7 +69,7 @@
)
-class W_Epoll(Wrappable):
+class W_Epoll(W_Root):
def __init__(self, space, epfd):
self.epfd = epfd
diff --git a/pypy/module/select/interp_select.py b/pypy/module/select/interp_select.py
--- a/pypy/module/select/interp_select.py
+++ b/pypy/module/select/interp_select.py
@@ -1,5 +1,5 @@
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
@@ -16,7 +16,7 @@
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 = {}
diff --git a/pypy/module/thread/os_local.py b/pypy/module/thread/os_local.py
--- a/pypy/module/thread/os_local.py
+++ b/pypy/module/thread/os_local.py
@@ -1,11 +1,12 @@
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
@@ -14,7 +15,7 @@
ExecutionContext._thread_local_objs = None
-class Local(Wrappable):
+class Local(W_Root):
"""Thread-local data"""
@jit.dont_look_inside
diff --git a/pypy/module/thread/os_lock.py b/pypy/module/thread/os_lock.py
--- a/pypy/module/thread/os_lock.py
+++ b/pypy/module/thread/os_lock.py
@@ -4,7 +4,7 @@
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
@@ -23,8 +23,8 @@
## 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
diff --git a/pypy/module/zipimport/interp_zipimport.py b/pypy/module/zipimport/interp_zipimport.py
--- a/pypy/module/zipimport/interp_zipimport.py
+++ b/pypy/module/zipimport/interp_zipimport.py
@@ -1,5 +1,5 @@
-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
@@ -30,7 +30,7 @@
def get_error(space):
return space.fromcache(Cache).w_error
-class W_ZipCache(Wrappable):
+class W_ZipCache(W_Root):
def __init__(self):
self.cache = {}
@@ -114,7 +114,7 @@
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
@@ -125,7 +125,7 @@
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):
@@ -406,4 +406,3 @@
archive = GetSetProperty(W_ZipImporter.getarchive),
prefix = GetSetProperty(W_ZipImporter.getprefix),
)
-
diff --git a/pypy/module/zlib/interp_zlib.py b/pypy/module/zlib/interp_zlib.py
--- a/pypy/module/zlib/interp_zlib.py
+++ b/pypy/module/zlib/interp_zlib.py
@@ -1,6 +1,6 @@
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
@@ -109,7 +109,7 @@
return space.wrap(result)
-class ZLibObject(Wrappable):
+class ZLibObject(W_Root):
"""
Common base class for Compress and Decompress.
"""
diff --git a/pypy/objspace/fake/test/test_objspace.py b/pypy/objspace/fake/test/test_objspace.py
--- a/pypy/objspace/fake/test/test_objspace.py
+++ b/pypy/objspace/fake/test/test_objspace.py
@@ -2,9 +2,9 @@
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()
@@ -55,7 +55,8 @@
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))
More information about the pypy-commit
mailing list