Author: Antonio Cuni <[email protected]>
Branch: cpyext-refactor-methodobject
Changeset: r92762:b05962717d68
Date: 2017-10-14 15:32 +0200
http://bitbucket.org/pypy/pypy/changeset/b05962717d68/
Log: rename these classes
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
@@ -97,7 +97,7 @@
else:
return space.w_None
-class W_PyCFunctionObjectNoArgs(W_PyCFunctionObject):
+class W_PyCFunctionObject_NOARGS(W_PyCFunctionObject):
def call(self, space, w_self, w_args, w_kw):
# Call the C function
if w_self is None:
@@ -105,7 +105,7 @@
func = self.ml.c_ml_meth
return generic_cpy_call(space, func, w_self, None)
-class W_PyCFunctionObjectSingleObject(W_PyCFunctionObject):
+class W_PyCFunctionObject_O(W_PyCFunctionObject):
def call(self, space, w_self, w_o, w_kw):
if w_self is None:
w_self = self.w_self
@@ -243,12 +243,12 @@
def cfunction_descr_call_noargs(space, w_self):
# special case for calling with flags METH_NOARGS
- self = space.interp_w(W_PyCFunctionObjectNoArgs, w_self)
+ self = space.interp_w(W_PyCFunctionObject_NOARGS, w_self)
return self.call(space, None, None, None)
def cfunction_descr_call_single_object(space, w_self, w_o):
# special case for calling with flags METH_O
- self = space.interp_w(W_PyCFunctionObjectSingleObject, w_self)
+ self = space.interp_w(W_PyCFunctionObject_O, w_self)
return self.call(space, None, w_o, None)
@jit.dont_look_inside
@@ -305,25 +305,25 @@
)
W_PyCFunctionObject.typedef.acceptable_as_base_class = False
-W_PyCFunctionObjectNoArgs.typedef = TypeDef(
+W_PyCFunctionObject_NOARGS.typedef = TypeDef(
'builtin_function_or_method', W_PyCFunctionObject.typedef,
__call__ = interp2app(cfunction_descr_call_noargs),
- __doc__ = GetSetProperty(W_PyCFunctionObjectNoArgs.get_doc),
- __module__ = interp_attrproperty_w('w_module',
cls=W_PyCFunctionObjectNoArgs),
- __name__ = interp_attrproperty('name', cls=W_PyCFunctionObjectNoArgs,
+ __doc__ = GetSetProperty(W_PyCFunctionObject_NOARGS.get_doc),
+ __module__ = interp_attrproperty_w('w_module',
cls=W_PyCFunctionObject_NOARGS),
+ __name__ = interp_attrproperty('name', cls=W_PyCFunctionObject_NOARGS,
wrapfn="newtext_or_none"),
)
-W_PyCFunctionObjectNoArgs.typedef.acceptable_as_base_class = False
+W_PyCFunctionObject_NOARGS.typedef.acceptable_as_base_class = False
-W_PyCFunctionObjectSingleObject.typedef = TypeDef(
+W_PyCFunctionObject_O.typedef = TypeDef(
'builtin_function_or_method', W_PyCFunctionObject.typedef,
__call__ = interp2app(cfunction_descr_call_single_object),
- __doc__ = GetSetProperty(W_PyCFunctionObjectSingleObject.get_doc),
- __module__ = interp_attrproperty_w('w_module',
cls=W_PyCFunctionObjectSingleObject),
- __name__ = interp_attrproperty('name', cls=W_PyCFunctionObjectSingleObject,
+ __doc__ = GetSetProperty(W_PyCFunctionObject_O.get_doc),
+ __module__ = interp_attrproperty_w('w_module', cls=W_PyCFunctionObject_O),
+ __name__ = interp_attrproperty('name', cls=W_PyCFunctionObject_O,
wrapfn="newtext_or_none"),
)
-W_PyCFunctionObjectSingleObject.typedef.acceptable_as_base_class = False
+W_PyCFunctionObject_O.typedef.acceptable_as_base_class = False
W_PyCMethodObject.typedef = TypeDef(
'method_descriptor',
diff --git a/pypy/module/cpyext/modsupport.py b/pypy/module/cpyext/modsupport.py
--- a/pypy/module/cpyext/modsupport.py
+++ b/pypy/module/cpyext/modsupport.py
@@ -7,7 +7,7 @@
from pypy.module.cpyext.methodobject import (
W_PyCFunctionObject, PyCFunction_NewEx, PyDescr_NewMethod,
PyMethodDef, PyDescr_NewClassMethod, PyStaticMethod_New,
- W_PyCFunctionObjectNoArgs, W_PyCFunctionObjectSingleObject)
+ W_PyCFunctionObject_NOARGS, W_PyCFunctionObject_O)
from pypy.module.cpyext.pyerrors import PyErr_BadInternalCall
from pypy.module.cpyext.state import State
from pypy.interpreter.error import oefmt
@@ -84,9 +84,9 @@
def _create_pyc_function_object(space, method, w_self, w_name, flags):
flags &= ~(METH_CLASS | METH_STATIC | METH_COEXIST)
if flags == METH_NOARGS:
- return W_PyCFunctionObjectNoArgs(space, method, w_self, w_name)
+ return W_PyCFunctionObject_NOARGS(space, method, w_self, w_name)
if flags == METH_O:
- return W_PyCFunctionObjectSingleObject(space, method, w_self, w_name)
+ return W_PyCFunctionObject_O(space, method, w_self, w_name)
return W_PyCFunctionObject(space, method, w_self, w_name)
def convert_method_defs(space, dict_w, methods, w_type, w_self=None,
name=None):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit