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

SourceForge.net noreply at sourceforge.net
Sat Sep 30 13:00:27 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: Closed
>Resolution: Fixed
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-09-30 11:00

Message:
Logged In: YES 
user_id=849994

Yes, it seems so.

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

Comment By: Žiga Seilnacht (zseil)
Date: 2006-06-02 02:02

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


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

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

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

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

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