[pypy-svn] r54039 - in pypy/dist/pypy: interpreter module/cStringIO objspace/std

arigo at codespeak.net arigo at codespeak.net
Wed Apr 23 12:35:53 CEST 2008


Author: arigo
Date: Wed Apr 23 12:35:52 2008
New Revision: 54039

Modified:
   pypy/dist/pypy/interpreter/baseobjspace.py
   pypy/dist/pypy/module/cStringIO/interp_stringio.py
   pypy/dist/pypy/objspace/std/intobject.py
Log:
Silence some of the innocent "demoting method to base class" warnings.


Modified: pypy/dist/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/dist/pypy/interpreter/baseobjspace.py	(original)
+++ pypy/dist/pypy/interpreter/baseobjspace.py	Wed Apr 23 12:35:52 2008
@@ -65,6 +65,9 @@
         raise OperationError(space.w_TypeError,
                              space.wrap("__class__ assignment: only for heap types"))
 
+    def user_setup(self, space, w_subtype):
+        assert False, "only for interp-level user subclasses from typedef.py"
+
     def getname(self, space, default):
         try:
             return space.str_w(space.getattr(self, space.wrap('__name__')))

Modified: pypy/dist/pypy/module/cStringIO/interp_stringio.py
==============================================================================
--- pypy/dist/pypy/module/cStringIO/interp_stringio.py	(original)
+++ pypy/dist/pypy/module/cStringIO/interp_stringio.py	Wed Apr 23 12:35:52 2008
@@ -86,6 +86,15 @@
         return self.space.wrap(self.tell())
     descr_tell.unwrap_spec = ['self']
 
+    # abstract methods
+    def close(self):                  assert False, "abstract"
+    def is_closed(self):              assert False, "abstract"
+    def getvalue(self):               assert False, "abstract"
+    def read(self, n=-1):             assert False, "abstract"
+    def readline(self, size=-1):      assert False, "abstract"
+    def seek(self, position, mode=0): assert False, "abstract"
+    def tell(self):                   assert False, "abstract"
+
 # ____________________________________________________________
 
 class W_InputType(W_InputOutputType):
@@ -143,7 +152,7 @@
 
 # ____________________________________________________________
 
-class W_OutputType(W_InputOutputType, RStringIO):
+class W_OutputType(RStringIO, W_InputOutputType):
     def __init__(self, space):
         RStringIO.__init__(self)
         self.space = space

Modified: pypy/dist/pypy/objspace/std/intobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/intobject.py	(original)
+++ pypy/dist/pypy/objspace/std/intobject.py	Wed Apr 23 12:35:52 2008
@@ -12,6 +12,7 @@
 """
 
 class W_IntObject(W_Object):
+    __slots__ = 'intval'
     from pypy.objspace.std.inttype import int_typedef as typedef
     
     def __init__(w_self, intval):



More information about the Pypy-commit mailing list