Terry J. Reedy added the comment:

Attached is patch for 2.7 with all tests passing. 3.x get_argspec cannot 
replace 2.x get_arg_text because it uses inspect.getfullargspec, which does not 
exist in 2.7. (Its use made the code simpler.) Besides minor changes in 
test_calltips.py, I made 3 changes to get_arg_text() to get tests to pass.
1. Stop deleting first parameter for unbound methods (bugfix).
2. Replace class instances with __call__ methods (bugfix).
3. Change tip for def f(*some_name, **other_name) from '(..., ***)' to '(*args, 
**kwds)'. 2.7 either does not keep the dummy names, which anyway cannot be used 
when calling , or the current code makes no effort to retrieve them.

My reasons for 3. are that the replacement is a) the current convention 
everywhere else, b) more like the corresponding 3.x tip (which has the exact 
names), and c) more indicative of what one actually writes in a call.

----------
Added file: http://bugs.python.org/file33543/test_calltips-27.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20122>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to