Merge branch 'add-partialmethod' of https://github.com/ffe4/jedi

This commit is contained in:
Dave Halter
2020-03-14 00:28:06 +01:00
3 changed files with 84 additions and 7 deletions

View File

@@ -158,6 +158,46 @@ tup[0]
#? float()
tup[1]
class X:
def function(self, a, b):
return a, b
a = functools.partialmethod(function, 0)
kw = functools.partialmethod(function, b=1.0)
#? int()
X().a('')[0]
#? str()
X().a('')[1]
#? int()
X.a('')[0]
#? str()
X.a('')[1]
#? int()
X.a(X(), '')[0]
#? str()
X.a(X(), '')[1]
tup = X().kw(1)
#? int()
tup[0]
#? float()
tup[1]
tup = X.kw(1)
#? int()
tup[0]
#? float()
tup[1]
tup = X.kw(X(), 1)
#? int()
tup[0]
#? float()
tup[1]
def my_decorator(f):
@functools.wraps(f)
def wrapper(*args, **kwds):