Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inspect.getargspec() is wrong for def foo((x)): #43096

Closed
nnorwitz mannequin opened this issue Mar 27, 2006 · 5 comments
Closed

inspect.getargspec() is wrong for def foo((x)): #43096

nnorwitz mannequin opened this issue Mar 27, 2006 · 5 comments
Labels
stdlib Python modules in the Lib dir

Comments

@nnorwitz
Copy link
Mannequin

nnorwitz mannequin commented Mar 27, 2006

BPO 1459159
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2006-09-30.11:00:27.000>
created_at = <Date 2006-03-27.09:05:54.000>
labels = ['library']
title = 'inspect.getargspec() is wrong for def foo((x)):'
updated_at = <Date 2006-09-30.11:00:27.000>
user = 'https://bugs.python.org/nnorwitz'

bugs.python.org fields:

activity = <Date 2006-09-30.11:00:27.000>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2006-03-27.09:05:54.000>
creator = 'nnorwitz'
dependencies = []
files = []
hgrepos = []
issue_num = 1459159
keywords = []
message_count = 5.0
messages = ['27898', '27899', '27900', '27901', '27902']
nosy_count = 3.0
nosy_names = ['nnorwitz', 'georg.brandl', 'zseil']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1459159'
versions = ['Python 2.4']

@nnorwitz
Copy link
Mannequin Author

nnorwitz mannequin commented Mar 27, 2006

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.

@nnorwitz nnorwitz mannequin closed this as completed Mar 27, 2006
@nnorwitz nnorwitz mannequin added the stdlib Python modules in the Lib dir label Mar 27, 2006
@nnorwitz nnorwitz mannequin closed this as completed Mar 27, 2006
@nnorwitz nnorwitz mannequin added the stdlib Python modules in the Lib dir label Mar 27, 2006
@birkenfeld
Copy link
Member

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

@birkenfeld
Copy link
Member

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.

@zseil
Copy link
Mannequin

zseil mannequin commented Jun 2, 2006

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.

@birkenfeld
Copy link
Member

Logged In: YES
user_id=849994

Yes, it seems so.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant