Commit 3037cc62 authored by Armin Rigo's avatar Armin Rigo

Convert some classes in rlib away from using _mixin_. These classes

can either be directly instantiated (and then they are not mixins at
all), or we can use import_from_mixin(), as done now in pypy/module/.
parent 6ddffd07
......@@ -4,12 +4,15 @@ from pypy.interpreter.typedef import (
from pypy.interpreter.gateway import interp2app, unwrap_spec
from rpython.rlib.rStringIO import RStringIO
from rpython.rlib.rarithmetic import r_longlong
from rpython.rlib.objectmodel import import_from_mixin
from pypy.module._io.interp_bufferedio import W_BufferedIOBase
from pypy.module._io.interp_iobase import convert_size
import sys
class W_BytesIO(RStringIO, W_BufferedIOBase):
class W_BytesIO(W_BufferedIOBase):
import_from_mixin(RStringIO)
def __init__(self, space):
W_BufferedIOBase.__init__(self, space, add_to_autoflusher=False)
self.init()
......
from rpython.rlib import rmd5
from rpython.rlib.objectmodel import import_from_mixin
from pypy.interpreter.baseobjspace import W_Root
from pypy.interpreter.typedef import TypeDef
from pypy.interpreter.gateway import interp2app, unwrap_spec
class W_MD5(W_Root, rmd5.RMD5):
class W_MD5(W_Root):
"""
A subclass of RMD5 that can be exposed to app-level.
"""
import_from_mixin(rmd5.RMD5)
def __init__(self, space):
self.space = space
......
from rpython.rlib import rsha
from rpython.rlib.objectmodel import import_from_mixin
from pypy.interpreter.baseobjspace import W_Root
from pypy.interpreter.typedef import TypeDef
from pypy.interpreter.gateway import interp2app, unwrap_spec
class W_SHA(W_Root, rsha.RSHA):
class W_SHA(W_Root):
"""
A subclass of RSHA that can be exposed to app-level.
"""
import_from_mixin(rsha.RSHA)
def __init__(self, space):
self.space = space
......
......@@ -3,6 +3,7 @@ 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
from rpython.rlib.objectmodel import import_from_mixin
class W_InputOutputType(W_Root):
......@@ -144,7 +145,9 @@ class W_InputType(W_InputOutputType):
# ____________________________________________________________
class W_OutputType(RStringIO, W_InputOutputType):
class W_OutputType(W_InputOutputType):
import_from_mixin(RStringIO)
def __init__(self, space):
self.init()
self.space = space
......
......@@ -8,8 +8,6 @@ class RStringIO(object):
The fastest path through this code is for the case of a bunch of write()
followed by getvalue().
"""
_mixin_ = True # for interp_stringio.py
def __init__(self):
self.init()
......
......@@ -132,8 +132,6 @@ XX._annspecialcase_ = 'specialize:arg(0)' # performance hint
class RMD5(object):
"""RPython-level MD5 object.
"""
_mixin_ = True # for interp_md5.py
def __init__(self, initialdata=''):
self._init()
self.update(initialdata)
......
......@@ -95,8 +95,6 @@ if UNROLL_ALL:
class RSHA(object):
"""RPython-level SHA object.
"""
_mixin_ = True # for interp_sha.py
def __init__(self, initialdata=''):
self._init()
self.update(initialdata)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment