1
0
forked from VimPlug/jedi

*args without self but still an implicit self from a method decorator

This commit is contained in:
Dave Halter
2014-06-12 21:32:49 +02:00
parent 371ec888e9
commit acfa40afa7
2 changed files with 23 additions and 11 deletions

View File

@@ -242,6 +242,22 @@ def xargs(*args):
xargs(1)
xargs('')
# *args without a self symbol
def memoize(func):
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
return wrapper
class Something():
@memoize
def x(self, a, b=1):
return a
Something().x(1)
# -----------------
# ** kwargs
# -----------------