[pypy-svn] r77738 - in pypy/branch/fast-forward/pypy/interpreter: . test
afa at codespeak.net
afa at codespeak.net
Sat Oct 9 00:05:39 CEST 2010
Author: afa
Date: Sat Oct 9 00:05:38 2010
New Revision: 77738
Modified:
pypy/branch/fast-forward/pypy/interpreter/test/test_function.py
pypy/branch/fast-forward/pypy/interpreter/typedef.py
Log:
add function.__code__ and function.__defaults__
(py3k renamed the attributes)
Modified: pypy/branch/fast-forward/pypy/interpreter/test/test_function.py
==============================================================================
--- pypy/branch/fast-forward/pypy/interpreter/test/test_function.py (original)
+++ pypy/branch/fast-forward/pypy/interpreter/test/test_function.py Sat Oct 9 00:05:38 2010
@@ -32,6 +32,8 @@
assert f.__name__ == f.func_name
assert f.__doc__ == f.func_doc
assert f.__dict__ is f.func_dict
+ assert f.__code__ is f.func_code
+ assert f.__defaults__ is f.func_defaults
assert hasattr(f, '__class__')
def test_write_doc(self):
Modified: pypy/branch/fast-forward/pypy/interpreter/typedef.py
==============================================================================
--- pypy/branch/fast-forward/pypy/interpreter/typedef.py (original)
+++ pypy/branch/fast-forward/pypy/interpreter/typedef.py Sat Oct 9 00:05:38 2010
@@ -770,9 +770,11 @@
func_defaults = getset_func_defaults,
func_globals = interp_attrproperty_w('w_func_globals', cls=Function),
func_closure = GetSetProperty( Function.fget_func_closure ),
+ __code__ = getset_func_code,
__doc__ = getset_func_doc,
__name__ = getset_func_name,
__dict__ = getset_func_dict,
+ __defaults__ = getset_func_defaults,
__module__ = getset___module__,
__weakref__ = make_weakref_descr(Function),
)
More information about the Pypy-commit
mailing list