◐ Shell
clean mode source ↗

Message 162324 - Python tracker

The reoganization in i12510.test.diff will make back-porting to 2.7 slightly more difficult since old and new style classes exist. I do agree with your reasoning for re-factoring the code. (Also, as an extremely minor point, running reindent.py adjusts "pos = 70".)

I applied the patch and it works under 11.04 Ubuntu. All the tests pass and the behavior of the CallTip gives reasonable results when used interactively.

I did manage to find a corner-case where a CallTip should arise:
    >>> class A:
            def __init__(self, a=None):
                print('init')
            def __call__(self, b=None):
                print('call')
		
    >>> c = A(

Gives "(a=None)" as the call-tip. However, once the object is created, giving the __call__ argument doesn't work, i.e. 

    >>> c(

doesn't give a call-tip. This behavior is also the same without the patch.

I'll keep playing with the patch to see what else needs improving with CallTips. We might as well fix it completely.