[ python-Bugs-1459159 ] inspect.getargspec() is wrong for def foo((x)):

SourceForge.net noreply at sourceforge.net
Mon Mar 27 13:38:38 CEST 2006


Bugs item #1459159, was opened at 2006-03-27 09:05
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1459159&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: Nobody/Anonymous (nobody)
Summary: inspect.getargspec() is wrong for def foo((x)):

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-03-27 11:38

Message:
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


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1459159&group_id=5470


More information about the Python-bugs-list mailing list