Issue 1459159: inspect.getargspec() is wrong for def foo((x)): (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/43096

classification

Title: inspect.getargspec() is wrong for def foo((x)):
Type: Stage:
Components: Library (Lib) Versions: Python 2.4

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, nnorwitz, zseil
Priority: normal Keywords:

Created on 2006-03-27 09:05 by nnorwitz, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg27898 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-03-27 09:05
See my recent checkin on HEAD for fixing def foo((x)): in the AST compiler. I had to modify test_inspect because the above signature should not do tuple unpacking. inspect thinkgs it does though.
msg27899 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-03-27 11:38
Logged In: YES user_id=849994 That's a bit odd. Following defs: def bar((x)): pass def foo(x): pass In 2.4: >>> dis.dis(bar) 1 0 LOAD_FAST 0 (.0) 3 STORE_FAST 1 (x) 6 LOAD_CONST 0 (None) 9 RETURN_VALUE >>> dis.dis(foo) 1 0 LOAD_CONST 0 (None) 3 RETURN_VALUE In 2.5: >>> dis.dis(bar) 1 0 LOAD_CONST 0 (None) 3 RETURN_VALUE >>> dis.dis(foo) 1 0 LOAD_CONST 0 (None) 3 RETURN_VALUE
msg27900 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-03-27 11:39
Logged In: YES user_id=849994 This at least explains why test_inspect didn't fail for 2.5 after you had fixed the bug and modified the test.
msg27901 - (view) Author: Ziga Seilnacht (zseil) * (Python committer) Date: 2006-06-02 02:02
Logged In: YES user_id=1326842 Can this bug be closed? It seems that the only problem was test_inspect relying on the old behavior.
msg27902 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-09-30 11:00
Logged In: YES user_id=849994 Yes, it seems so.
History
Date User Action Args
2022-04-11 14:56:16 admin set github: 43096
2006-03-27 09:05:54 nnorwitz create