Author: Philip Jenvey <[email protected]>
Branch:
Changeset: r68571:fb1a1b3b4c80
Date: 2013-12-30 16:14 -0800
http://bitbucket.org/pypy/pypy/changeset/fb1a1b3b4c80/
Log: prefer the name 'self' for the sake of introspection
diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py
--- a/pypy/interpreter/gateway.py
+++ b/pypy/interpreter/gateway.py
@@ -805,8 +805,8 @@
raise TypeError("Varargs and keywords not supported in unwrap_spec")
argspec = ', '.join([arg for arg in args.args[1:]])
func_code = py.code.Source("""
- def f(w_obj, %(args)s):
- return w_obj.%(func_name)s(%(args)s)
+ def f(self, %(args)s):
+ return self.%(func_name)s(%(args)s)
""" % {'args': argspec, 'func_name': func.func_name})
d = {}
exec func_code.compile() in d
@@ -821,7 +821,7 @@
else:
assert isinstance(unwrap_spec, dict)
unwrap_spec = unwrap_spec.copy()
- unwrap_spec['w_obj'] = base_cls
+ unwrap_spec['self'] = base_cls
return interp2app(globals()['unwrap_spec'](**unwrap_spec)(f))
class interp2app(W_Root):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit