• Vincent Pelletier's avatar
    Fix magic "self" parameter detection. · 47ca5f17
    Vincent Pelletier authored
    Original code behaviour:
    >>> def foo(self, a=None):
    ...    return 'works'
    ...
    >>> context.foo(a=1)
    works
    >>> def foo(self, a):
    ...   return 'works'
    ...
    >>> context.foo(1)
    works
    >>> context.foo(a=1)
    TypeError: foo() takes exactly 2 non-keyword arguments (0 given)
    
    New behaviour fixes this TypeError, to be closer to normal python
    behaviour.
    Also, original code was doing expensive checks before cheap ones.
    47ca5f17
ExternalMethod.py 4.39 KB