[pypy-svn] pypy improve-unwrap_spec: GetSetProperty now accept arguments in both order: (space, self) or (self, space)

amauryfa commits-noreply at bitbucket.org
Thu Feb 17 00:42:24 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: improve-unwrap_spec
Changeset: r42092:fe81f52a772c
Date: 2011-02-17 00:36 +0100
http://bitbucket.org/pypy/pypy/changeset/fe81f52a772c/

Log:	GetSetProperty now accept arguments in both order: (space, self) or
	(self, space) Use the more natural order when the getter is a class
	method

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
@@ -58,10 +58,10 @@
         y = space.int_w(w_y)
         return space.wrap(self.x * y)
 
-    def fget_x(space, self):
+    def fget_x(self, space):
         return space.wrap(self.x)
 
-    def fset_x(space, self, w_value):
+    def fset_x(self, space, w_value):
         self.x = space.int_w(w_value)
 
 @unwrap_spec(x=int)

diff --git a/pypy/interpreter/pycode.py b/pypy/interpreter/pycode.py
--- a/pypy/interpreter/pycode.py
+++ b/pypy/interpreter/pycode.py
@@ -267,19 +267,19 @@
         co = self._to_code()
         dis.dis(co)
 
-    def fget_co_consts(space, self):
+    def fget_co_consts(self, space):
         return space.newtuple(self.co_consts_w)
     
-    def fget_co_names(space, self):
+    def fget_co_names(self, space):
         return space.newtuple(self.co_names_w)
 
-    def fget_co_varnames(space, self):
+    def fget_co_varnames(self, space):
         return space.newtuple([space.wrap(name) for name in self.co_varnames])
 
-    def fget_co_cellvars(space, self):
+    def fget_co_cellvars(self, space):
         return space.newtuple([space.wrap(name) for name in self.co_cellvars])
 
-    def fget_co_freevars(space, self):
+    def fget_co_freevars(self, space):
         return space.newtuple([space.wrap(name) for name in self.co_freevars])    
 
     def descr_code__eq__(self, w_other):

diff --git a/pypy/interpreter/pytraceback.py b/pypy/interpreter/pytraceback.py
--- a/pypy/interpreter/pytraceback.py
+++ b/pypy/interpreter/pytraceback.py
@@ -21,7 +21,7 @@
     def get_lineno(self):
         return offset2lineno(self.frame.pycode, self.lasti)
 
-    def descr_tb_lineno(space, self):
+    def descr_tb_lineno(self, space):
         return space.wrap(self.get_lineno())
 
     def descr__reduce__(self, space):

diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py
--- a/pypy/module/exceptions/interp_exceptions.py
+++ b/pypy/module/exceptions/interp_exceptions.py
@@ -140,10 +140,10 @@
         clsname = self.getclass(space).getname(space, '?')
         return space.wrap(clsname + args_repr)
 
-    def descr_getargs(space, self):
+    def descr_getargs(self, space):
         return space.newtuple(self.args_w)
 
-    def descr_setargs(space, self, w_newargs):
+    def descr_setargs(self, space, w_newargs):
         self.args_w = space.fixedview(w_newargs)
 
     def descr_getitem(self, space, w_index):
@@ -169,7 +169,7 @@
         w_olddict = self.getdict()
         space.call_method(w_olddict, 'update', w_dict)
 
-    def descr_message_get(space, self):
+    def descr_message_get(self, space):
         w_dict = self.w_dict
         if w_dict is not None:
             w_msg = space.finditem(w_dict, space.wrap("message"))
@@ -182,10 +182,10 @@
                    space.w_DeprecationWarning)
         return self.w_message
 
-    def descr_message_set(space, self, w_new):
+    def descr_message_set(self, space, w_new):
         space.setitem(self.getdict(), space.wrap("message"), w_new)
 
-    def descr_message_del(space, self):
+    def descr_message_del(self, space):
         w_dict = self.w_dict
         if w_dict is not None:
             try:

diff --git a/pypy/module/_stackless/interp_coroutine.py b/pypy/module/_stackless/interp_coroutine.py
--- a/pypy/module/_stackless/interp_coroutine.py
+++ b/pypy/module/_stackless/interp_coroutine.py
@@ -294,15 +294,15 @@
         setattr(AppCoroutine, meth.__name__, meth.im_func)
 del meth, methname
 
-def w_get_is_zombie(space, self):
+def w_get_is_zombie(self, space):
     return space.wrap(self.get_is_zombie())
 AppCoroutine.w_get_is_zombie = w_get_is_zombie
 
-def w_get_is_alive(space, self):
+def w_get_is_alive(self, space):
     return space.wrap(self.is_alive())
 AppCoroutine.w_get_is_alive = w_get_is_alive
 
-def w_descr__framestack(space, self):
+def w_descr__framestack(self, space):
     assert isinstance(self, AppCoroutine)
     counter = 0
     f = self.subctx.topframe

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
@@ -27,7 +27,7 @@
     def descr_nonzero(self, space):
         return space.wrap(self.as_int() != 0)
 
-    def descr_handle_get(space, self):
+    def descr_handle_get(self, space):
         return space.wrap(self.as_int())
 
     def descr_repr(self, space):

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
@@ -369,7 +369,7 @@
 
         self.fetchVariables = None
 
-    def getDescription(space, self):
+    def getDescription(self, space):
         "Return a list of 7-tuples consisting of the description of "
         "the define variables"
 
@@ -1046,23 +1046,23 @@
         self.outputSizeColumn = outputSizeColumn
 
 
-    def arraysize_get(space, self):
+    def arraysize_get(self, space):
         return space.wrap(self.arraySize)
-    def arraysize_set(space, self, w_value):
+    def arraysize_set(self, space, w_value):
         self.arraySize = space.int_w(w_value)
 
-    def bindarraysize_get(space, self):
+    def bindarraysize_get(self, space):
         return space.wrap(self.bindArraySize)
-    def bindarraysize_set(space, self, w_value):
+    def bindarraysize_set(self, space, w_value):
         self.bindArraySize = space.int_w(w_value)
 
-    def bindvars_get(space, self):
+    def bindvars_get(self, space):
         if self.bindList:
             return space.newlist(self.bindList)
         if self.bindDict:
             return self.bindDict
 
-    def fetchvars_get(space, self):
+    def fetchvars_get(self, space):
         return space.newlist(self.fetchVariables)
 
 W_Cursor.typedef = TypeDef(

diff --git a/pypy/module/cpyext/methodobject.py b/pypy/module/cpyext/methodobject.py
--- a/pypy/module/cpyext/methodobject.py
+++ b/pypy/module/cpyext/methodobject.py
@@ -102,7 +102,7 @@
                 w_arg = w_args
             return generic_cpy_call(space, func, w_self, w_arg)
 
-    def get_doc(space, self):
+    def get_doc(self, space):
         doc = self.ml.c_ml_doc
         if doc:
             return space.wrap(rffi.charp2str(doc))

diff --git a/pypy/interpreter/nestedscope.py b/pypy/interpreter/nestedscope.py
--- a/pypy/interpreter/nestedscope.py
+++ b/pypy/interpreter/nestedscope.py
@@ -67,7 +67,7 @@
         return "<%s(%s) at 0x%x>" % (self.__class__.__name__,
                                      content, uid(self))
 
-    def descr__cell_contents(space, self):
+    def descr__cell_contents(self, space):
         try:
             return self.get()
         except ValueError:

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
@@ -117,7 +117,7 @@
             space.getbuiltinmodule('zipimport'),
             space.wrap('ZipImportError'))
 
-    def getprefix(space, self):
+    def getprefix(self, space):
         return space.wrap(self.prefix)
 
     def _find_relative_path(self, filename):
@@ -331,7 +331,7 @@
         raise operationerrfmt(self.w_ZipImportError,
             "Cannot find module %s in %s", filename, self.name)
 
-    def getarchive(space, self):
+    def getarchive(self, space):
         space = self.space
         return space.wrap(self.filename)
 

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
@@ -600,21 +600,21 @@
         self.w_error = w_error
         return OperationError(w_errorcls, w_error)
 
-    def descr_ErrorCode(space, self):
+    def descr_ErrorCode(self, space):
         return space.wrap(XML_GetErrorCode(self.itself))
 
-    def descr_ErrorLineNumber(space, self):
+    def descr_ErrorLineNumber(self, space):
         return space.wrap(XML_GetErrorLineNumber(self.itself))
 
-    def descr_ErrorColumnNumber(space, self):
+    def descr_ErrorColumnNumber(self, space):
         return space.wrap(XML_GetErrorColumnNumber(self.itself))
 
-    def descr_ErrorByteIndex(space, self):
+    def descr_ErrorByteIndex(self, space):
         return space.wrap(XML_GetErrorByteIndex(self.itself))
 
-    def get_buffer_size(space, self):
+    def get_buffer_size(self, space):
         return space.wrap(self.buffer_size)
-    def set_buffer_size(space, self, w_value):
+    def set_buffer_size(self, space, w_value):
         value = space.getindex_w(w_value, space.w_TypeError)
         if value <= 0:
             raise OperationError(space.w_ValueError, space.wrap(
@@ -622,9 +622,9 @@
         self.flush_character_buffer(space)
         self.buffer_size = value
 
-    def get_buffer_text(space, self):
+    def get_buffer_text(self, space):
         return space.wrap(self.buffer_w is not None)
-    def set_buffer_text(space, self, w_value):
+    def set_buffer_text(self, space, w_value):
         if space.is_true(w_value):
             self.buffer_w = []
             self.buffer_used = 0
@@ -632,7 +632,7 @@
             self.flush_character_buffer(space)
             self.buffer_w = None
 
-    def get_intern(space, self):
+    def get_intern(self, space):
         if self.w_intern:
             return self.w_intern
         else:

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
@@ -17,7 +17,7 @@
         self.tt = tt
         self.w_calls = w_sublist
 
-    def get_calls(space, self):
+    def get_calls(self, space):
         return self.w_calls
 
     def repr(self, space):
@@ -30,7 +30,7 @@
             frame_repr, self.callcount, self.reccallcount,
             self.tt, self.it, calls_repr))
 
-    def get_code(space, self):
+    def get_code(self, space):
         return self.frame
 
 W_StatsEntry.typedef = TypeDef(
@@ -57,7 +57,7 @@
         return space.wrap('("%s", %d, %d, %f, %f)' % (
             frame_repr, self.callcount, self.reccallcount, self.tt, self.it))
 
-    def get_code(space, self):
+    def get_code(self, space):
         return self.frame
 
 W_StatsSubEntry.typedef = TypeDef(

diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py
--- a/pypy/module/_io/interp_textio.py
+++ b/pypy/module/_io/interp_textio.py
@@ -964,7 +964,7 @@
         self._check_init(space)
         return space.wrap(self.chunk_size)
 
-    def chunk_size_set_w(space, self, w_size):
+    def chunk_size_set_w(self, space, w_size):
         self._check_init(space)
         size = space.int_w(w_size)
         if size <= 0:

diff --git a/pypy/module/_multiprocessing/interp_semaphore.py b/pypy/module/_multiprocessing/interp_semaphore.py
--- a/pypy/module/_multiprocessing/interp_semaphore.py
+++ b/pypy/module/_multiprocessing/interp_semaphore.py
@@ -402,11 +402,11 @@
         self.count = 0
         self.maxvalue = maxvalue
 
-    def kind_get(space, self):
+    def kind_get(self, space):
         return space.newint(self.kind)
-    def maxvalue_get(space, self):
+    def maxvalue_get(self, space):
         return space.newint(self.maxvalue)
-    def handle_get(space, self):
+    def handle_get(self, space):
         return w_handle(space, self.handle)
 
     def get_count(self, space):

diff --git a/pypy/module/_multiprocessing/interp_connection.py b/pypy/module/_multiprocessing/interp_connection.py
--- a/pypy/module/_multiprocessing/interp_connection.py
+++ b/pypy/module/_multiprocessing/interp_connection.py
@@ -53,11 +53,11 @@
     def close(self):
         self.do_close()
 
-    def closed_get(space, self):
+    def closed_get(self, space):
         return space.newbool(not self.is_valid())
-    def readable_get(space, self):
+    def readable_get(self, space):
         return space.newbool(bool(self.flags & READABLE))
-    def writable_get(space, self):
+    def writable_get(self, space):
         return space.newbool(bool(self.flags & WRITABLE))
 
     def _check_readable(self, space):

diff --git a/pypy/module/_stackless/interp_greenlet.py b/pypy/module/_stackless/interp_greenlet.py
--- a/pypy/module/_stackless/interp_greenlet.py
+++ b/pypy/module/_stackless/interp_greenlet.py
@@ -139,13 +139,13 @@
     def isdead(self):
         return self.thunk is None and not self.active
 
-    def w_get_is_dead(space, self):
+    def w_get_is_dead(self, space):
         return space.newbool(self.isdead())
 
     def descr__nonzero__(self):
         return self.space.newbool(self.active)
 
-    def w_get_run(space, self):
+    def w_get_run(self, space):
         w_run = self.w_callable
         if w_run is None:
             raise OperationError(space.w_AttributeError, space.wrap("run"))
@@ -159,15 +159,15 @@
                                             "after the start of the greenlet"))
         self.w_callable = w_run
 
-    def w_set_run(space, self, w_run):
+    def w_set_run(self, space, w_run):
         self.set_run(w_run)
 
-    def w_del_run(space, self):
+    def w_del_run(self, space):
         if self.w_callable is None:
             raise OperationError(space.w_AttributeError, space.wrap("run"))
         self.w_callable = None
 
-    def w_get_parent(space, self):
+    def w_get_parent(self, space):
         return space.wrap(self.parent)
 
     def set_parent(self, w_parent):
@@ -184,10 +184,10 @@
             curr = curr.parent
         self.parent = newparent
 
-    def w_set_parent(space, self, w_parent):
+    def w_set_parent(self, space, w_parent):
         self.set_parent(w_parent)
 
-    def w_get_frame(space, self):
+    def w_get_frame(self, space):
         if not self.active or self.costate.current is self:
             f = None
         else:

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
@@ -67,10 +67,10 @@
             result.append(hexdigits[ ord(c)       & 0xf])
         return space.wrap(result.build())
 
-    def get_digest_size(space, self):
+    def get_digest_size(self, space):
         return space.wrap(self._digest_size())
 
-    def get_block_size(space, self):
+    def get_block_size(self, space):
         return space.wrap(self._block_size())
 
     def _digest(self, space):

diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py
--- a/pypy/module/_sre/interp_sre.py
+++ b/pypy/module/_sre/interp_sre.py
@@ -431,7 +431,7 @@
             return mark.gid // 2 + 1
         return -1
 
-    def fget_lastgroup(space, self):
+    def fget_lastgroup(self, space):
         lastindex = self._last_index()
         if lastindex < 0:
             return space.w_None
@@ -441,19 +441,19 @@
             return space.w_None
         return w_result
 
-    def fget_lastindex(space, self):
+    def fget_lastindex(self, space):
         lastindex = self._last_index()
         if lastindex >= 0:
             return space.wrap(lastindex)
         return space.w_None
 
-    def fget_pos(space, self):
+    def fget_pos(self, space):
         return space.wrap(self.ctx.original_pos)
 
-    def fget_endpos(space, self):
+    def fget_endpos(self, space):
         return space.wrap(self.ctx.end)
 
-    def fget_regs(space, self):
+    def fget_regs(self, space):
         space = self.space
         fmarks = self.flatten_marks()
         num_groups = self.srepat.num_groups
@@ -466,7 +466,7 @@
                                               space.wrap(fmarks[i*2+1])])
         return space.newtuple(result_w)
 
-    def fget_string(space, self):
+    def fget_string(self, space):
         return self.ctx._w_string(space)
 
 

diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -127,16 +127,16 @@
             msg = "generator ignored GeneratorExit"
             raise OperationError(space.w_RuntimeError, space.wrap(msg))
 
-    def descr_gi_frame(space, self):
+    def descr_gi_frame(self, space):
         if self.frame is not None and not self.frame.frame_finished_execution:
             return self.frame
         else:
             return space.w_None
 
-    def descr_gi_code(space, self):
+    def descr_gi_code(self, space):
         return self.pycode
 
-    def descr__name__(space, self):
+    def descr__name__(self, space):
         code_name = self.pycode.co_name
         return space.wrap(code_name)
 

diff --git a/pypy/module/_rawffi/interp_rawffi.py b/pypy/module/_rawffi/interp_rawffi.py
--- a/pypy/module/_rawffi/interp_rawffi.py
+++ b/pypy/module/_rawffi/interp_rawffi.py
@@ -267,7 +267,7 @@
                 ll_buf = rffi.cast(lltype.Signed, self.ll_buffer)
                 tracker.trace_allocation(ll_buf, self)
 
-    def getbuffer(space, self):
+    def getbuffer(self, space):
         return space.wrap(rffi.cast(lltype.Unsigned, self.ll_buffer))
 
     def byptr(self, space):
@@ -370,18 +370,13 @@
         self.argshapes = argshapes
         self.resshape = resshape
 
-    def getbuffer(space, self):
-        return space.wrap(rffi.cast(lltype.Unsigned, self.ptr.funcsym))
-
-    # XXX exactly the same as previous one, but arguments are suitable
-    #     for calling with python
-    def _getbuffer(self, space):
+    def getbuffer(self, space):
         return space.wrap(rffi.cast(lltype.Unsigned, self.ptr.funcsym))
 
     def byptr(self, space):
         from pypy.module._rawffi.array import ARRAY_OF_PTRS
         array = ARRAY_OF_PTRS.allocate(space, 1)
-        array.setitem(space, 0, self._getbuffer(space))
+        array.setitem(space, 0, self.getbuffer(space))
         if tracker.DO_TRACING:
             # XXX this is needed, because functions tend to live forever
             #     hence our testing is not performing that well

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
@@ -172,7 +172,7 @@
         connection.handle = lltype.nullptr(roci.OCISvcCtx.TO)
 
 def computedProperty(oci_attr_code, oci_value_type):
-    def fget(space, self):
+    def fget(self, space):
         self.checkConnected(space)
 
         valueptr = lltype.malloc(rffi.CArrayPtr(oci_value_type).TO,

diff --git a/pypy/interpreter/function.py b/pypy/interpreter/function.py
--- a/pypy/interpreter/function.py
+++ b/pypy/interpreter/function.py
@@ -324,13 +324,13 @@
         self.defs_w    = space.fixedview(w_defs_w)
         self.w_module = w_module
 
-    def fget_func_defaults(space, self):
+    def fget_func_defaults(self, space):
         values_w = self.defs_w
         if not values_w or None in values_w:
             return space.w_None
         return space.newtuple(values_w)
 
-    def fset_func_defaults(space, self, w_defaults):
+    def fset_func_defaults(self, space, w_defaults):
         if space.is_w(w_defaults, space.w_None):
             self.defs_w = []
             return
@@ -338,21 +338,21 @@
             raise OperationError( space.w_TypeError, space.wrap("func_defaults must be set to a tuple object or None") )
         self.defs_w = space.fixedview(w_defaults)
 
-    def fdel_func_defaults(space, self):
+    def fdel_func_defaults(self, space):
         self.defs_w = []
 
-    def fget_func_doc(space, self):
+    def fget_func_doc(self, space):
         if self.w_doc is None:
             self.w_doc = self.code.getdocstring(space)
         return self.w_doc
 
-    def fset_func_doc(space, self, w_doc):
+    def fset_func_doc(self, space, w_doc):
         self.w_doc = w_doc
 
-    def fget_func_name(space, self):
+    def fget_func_name(self, space):
         return space.wrap(self.name)
 
-    def fset_func_name(space, self, w_name):
+    def fset_func_name(self, space, w_name):
         try:
             self.name = space.str_w(w_name)
         except OperationError, e:
@@ -363,10 +363,10 @@
             raise
 
 
-    def fdel_func_doc(space, self):
+    def fdel_func_doc(self, space):
         self.w_doc = space.w_None
 
-    def fget___module__(space, self):
+    def fget___module__(self, space):
         if self.w_module is None:
             if self.w_func_globals is not None and not space.is_w(self.w_func_globals, space.w_None):
                 self.w_module = space.call_method( self.w_func_globals, "get", space.wrap("__name__") )
@@ -374,16 +374,16 @@
                 self.w_module = space.w_None
         return self.w_module
 
-    def fset___module__(space, self, w_module):
+    def fset___module__(self, space, w_module):
         self.w_module = w_module
 
-    def fdel___module__(space, self):
+    def fdel___module__(self, space):
         self.w_module = space.w_None
 
-    def fget_func_code(space, self):
+    def fget_func_code(self, space):
         return space.wrap(self.code)
 
-    def fset_func_code(space, self, w_code):
+    def fset_func_code(self, space, w_code):
         from pypy.interpreter.pycode import PyCode
         if not self.can_change_code:
             raise OperationError(space.w_TypeError,
@@ -398,7 +398,7 @@
                 self.name, closure_len, len(code.co_freevars))
         self.code = code
 
-    def fget_func_closure(space, self):
+    def fget_func_closure(self, space):
         if self.closure is not None:
             w_res = space.newtuple( [ space.wrap(i) for i in self.closure ] )
         else:

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
@@ -271,7 +271,7 @@
             self.attributes.append(attribute)
             self.attributesByName[attribute.name] = attribute
 
-    def get_attributes(space, self):
+    def get_attributes(self, space):
         return space.newlist([space.wrap(attr) for attr in self.attributes])
 
 W_ObjectType.typedef = TypeDef(

diff --git a/pypy/module/__builtin__/interp_memoryview.py b/pypy/module/__builtin__/interp_memoryview.py
--- a/pypy/module/__builtin__/interp_memoryview.py
+++ b/pypy/module/__builtin__/interp_memoryview.py
@@ -105,19 +105,19 @@
     def descr_len(self, space):
         return self.buf.descr_len(space)
 
-    def w_get_format(space, self):
+    def w_get_format(self, space):
         return space.wrap("B")
-    def w_get_itemsize(space, self):
+    def w_get_itemsize(self, space):
         return space.wrap(1)
-    def w_get_ndim(space, self):
+    def w_get_ndim(self, space):
         return space.wrap(1)
-    def w_is_readonly(space, self):
+    def w_is_readonly(self, space):
         return space.wrap(not isinstance(self.buf, buffer.RWBuffer))
-    def w_get_shape(space, self):
+    def w_get_shape(self, space):
         return space.newtuple([space.wrap(self.getlength())])
-    def w_get_strides(space, self):
+    def w_get_strides(self, space):
         return space.newtuple([space.wrap(1)])
-    def w_get_suboffsets(space, self):
+    def w_get_suboffsets(self, space):
         # I've never seen anyone filling this field
         return space.w_None
 

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
@@ -104,7 +104,7 @@
             if result < 0:
                 raise exception_from_errno(self.space, self.space.w_IOError)
 
-    def descr_get_closed(space, self):
+    def descr_get_closed(self, space):
         return space.wrap(self.epfd < 0)
 
     def descr_fileno(self, space):

diff --git a/pypy/interpreter/eval.py b/pypy/interpreter/eval.py
--- a/pypy/interpreter/eval.py
+++ b/pypy/interpreter/eval.py
@@ -76,10 +76,10 @@
     def getcode(self):
         return None
 
-    def fget_code(space, self):
+    def fget_code(self, space):
         return space.wrap(self.getcode())
 
-    def fget_getdictscope(space, self): # unwrapping through unwrap_spec in typedef.py
+    def fget_getdictscope(self, space):
         return self.getdictscope()
 
     def setdictscope(self, w_locals):

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
@@ -197,13 +197,13 @@
 
 # ____________________________________________________________
 
-def descr_closed(space, self):
+def descr_closed(self, space):
     return space.wrap(self.is_closed())
 
-def descr_softspace(space, self):
+def descr_softspace(self, space):
     return space.wrap(self.softspace)
 
-def descr_setsoftspace(space, self, w_newvalue):
+def descr_setsoftspace(self, space, w_newvalue):
     self.softspace = space.int_w(w_newvalue)
 
 common_descrs = {

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
@@ -486,14 +486,14 @@
             rffi.keep_buffer_alive_until_here(charsetname_buf, charsetname)
         return space.wrap(charset)
 
-    def get_encoding(space, self):
+    def get_encoding(self, space):
         return self._getCharacterSetName(space, roci.OCI_ATTR_ENV_CHARSET_ID)
-    def get_nationalencoding(space, self):
+    def get_nationalencoding(self, space):
         return self._getCharacterSetName(space, roci.OCI_ATTR_ENV_CHARSET_ID)
-    def get_maxbytespercharacter(space, self):
+    def get_maxbytespercharacter(self, space):
         return space.wrap(self.environment.maxBytesPerCharacter)
 
-    def get_version(space, self):
+    def get_version(self, space):
         # if version has already been determined, no need to determine again
         if self.w_version:
             return self.w_version

diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py
--- a/pypy/interpreter/pyframe.py
+++ b/pypy/interpreter/pyframe.py
@@ -442,16 +442,14 @@
 
     ### line numbers ###
 
-    # for f*_f_* unwrapping through unwrap_spec in typedef.py
-
-    def fget_f_lineno(space, self): 
+    def fget_f_lineno(self, space): 
         "Returns the line number of the instruction currently being executed."
         if self.w_f_trace is None:
             return space.wrap(self.get_last_lineno())
         else:
             return space.wrap(self.f_lineno)
 
-    def fset_f_lineno(space, self, w_new_lineno):
+    def fset_f_lineno(self, space, w_new_lineno):
         "Returns the line number of the instruction currently being executed."
         try:
             new_lineno = space.int_w(w_new_lineno)
@@ -585,19 +583,19 @@
         "Returns the line number of the instruction currently being executed."
         return pytraceback.offset2lineno(self.pycode, self.last_instr)
 
-    def fget_f_builtins(space, self):
+    def fget_f_builtins(self, space):
         return self.get_builtin().getdict()
 
-    def fget_f_back(space, self):
+    def fget_f_back(self, space):
         return self.space.wrap(self.f_backref())
 
-    def fget_f_lasti(space, self):
+    def fget_f_lasti(self, space):
         return self.space.wrap(self.last_instr)
 
-    def fget_f_trace(space, self):
+    def fget_f_trace(self, space):
         return self.w_f_trace
 
-    def fset_f_trace(space, self, w_trace):
+    def fset_f_trace(self, space, w_trace):
         if space.is_w(w_trace, space.w_None):
             self.w_f_trace = None
         else:
@@ -605,10 +603,10 @@
             self.f_lineno = self.get_last_lineno()
             space.frame_trace_action.fire()
 
-    def fdel_f_trace(space, self): 
+    def fdel_f_trace(self, space): 
         self.w_f_trace = None 
 
-    def fget_f_exc_type(space, self):
+    def fget_f_exc_type(self, space):
         if self.last_exception is not None:
             f = self.f_backref()
             while f is not None and f.last_exception is None:
@@ -617,7 +615,7 @@
                 return f.last_exception.w_type
         return space.w_None
          
-    def fget_f_exc_value(space, self):
+    def fget_f_exc_value(self, space):
         if self.last_exception is not None:
             f = self.f_backref()
             while f is not None and f.last_exception is None:
@@ -626,7 +624,7 @@
                 return f.last_exception.get_w_value(space)
         return space.w_None
 
-    def fget_f_exc_traceback(space, self):
+    def fget_f_exc_traceback(self, space):
         if self.last_exception is not None:
             f = self.f_backref()
             while f is not None and f.last_exception is None:
@@ -635,7 +633,7 @@
                 return space.wrap(f.last_exception.application_traceback)
         return space.w_None
          
-    def fget_f_restricted(space, self):
+    def fget_f_restricted(self, space):
         if space.config.objspace.honor__builtins__:
             return space.wrap(self.builtin is not space.builtin)
         return space.w_False


More information about the Pypy-commit mailing list