[pypy-svn] r49272 - in pypy/dist: lib-python/modified-2.4.1 pypy/interpreter/test
arigo at codespeak.net
arigo at codespeak.net
Sun Dec 2 13:29:06 CET 2007
Author: arigo
Date: Sun Dec 2 13:29:04 2007
New Revision: 49272
Added:
pypy/dist/lib-python/modified-2.4.1/inspect.py
- copied, changed from r49241, pypy/dist/lib-python/2.4.1/inspect.py
Modified:
pypy/dist/pypy/interpreter/test/test_code.py
Log:
issue306 in-progress
Hacking at inspect.py to let getargs() decode the signature of our
internal-code' objects too.
Modified: pypy/dist/pypy/interpreter/test/test_code.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_code.py (original)
+++ pypy/dist/pypy/interpreter/test/test_code.py Sun Dec 2 13:29:04 2007
@@ -126,3 +126,12 @@
exec "def f(): pass" in d2
assert d1['f'].func_code == d2['f'].func_code
assert hash(d1['f'].func_code) == hash(d2['f'].func_code)
+
+ def test_inspect(self):
+ if not hasattr(len, 'func_code'):
+ skip("CPython: no func_code attribute on built-in functions")
+ import inspect
+ args, varargs, varkw = inspect.getargs(len.func_code)
+ assert args == ['obj']
+ assert varargs is None
+ assert varkw is None
More information about the Pypy-commit
mailing list