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
Idle 2.7: Calltip wrong if def contains float default value #62739
Comments
When defining a function with factional default arguments, the <tuple> text replaces the correct values in the tooltip. Here's an example - >>> def f(a=0.5):
pass
>>> f( tooltip shows - "(a=0<tuple>)", i.e. replaces the ".5" with <tuple>. This was found to happen on IDLE with python 2.7.3 and 2.7.5 (the latter was on 64 bit python installation on a windows 7 machine). The problem was discussed here - I believe this is the result of a fix to bpo-791968. |
If you are the same 'ariel' as on SO, thank you for the detective work and the informative report here. Without it this 2.7-only bug would be low priority and might have sat open until we stopped patching 2.7. The underlying issue is that a) 2.x had the 'feature' of allowing tuples of parameter names to signal automatic unpacking of tuples of arguments, and b) the unnamed tuple got a pseudoname of the form '.n' in the list of argument names, which calltips uses. >>> def f((a,b), (c,d)): pass
>>> f.func_code.co_varnames
('.0', '.1', 'a', 'b', 'c', 'd') Issue bpo-791968 added the following line to change '.n' to '<tuple>'. |
New changeset 3236709650b0 by Terry Jan Reedy in branch '2.7': |
Superb, and thanks for doing the actual work on fixing it. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: