mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-22 21:31:26 +08:00
Fix an issue with partial keyword inputs.
This commit is contained in:
@@ -6,4 +6,4 @@ class partial():
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
# I know this doesn't work in Python, but in Jedi it does ;-)
|
||||
return self.__func(*self.__args, *args, **self.keywords, **kwargs)
|
||||
return self.__func(*self.__args, *args, **self.__keywords, **kwargs)
|
||||
|
||||
@@ -78,15 +78,22 @@ basetwo = functools.partial(int, base=2)
|
||||
#? int()
|
||||
basetwo()
|
||||
|
||||
def a(a, b):
|
||||
def function(a, b):
|
||||
return a, b
|
||||
a = functools.partial(a, 0)
|
||||
a = functools.partial(function, 0)
|
||||
|
||||
#? int()
|
||||
a('')[0]
|
||||
#? str()
|
||||
a('')[1]
|
||||
|
||||
kw = functools.partial(function, b=1.0)
|
||||
tup = kw(1)
|
||||
#? int()
|
||||
tup[0]
|
||||
#? float()
|
||||
tup[1]
|
||||
|
||||
def my_decorator(f):
|
||||
@functools.wraps(f)
|
||||
def wrapper(*args, **kwds):
|
||||
|
||||
Reference in New Issue
Block a user