Explorar el Código

Allow functools partials to be used with the InlineTransformer

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.5.6
night199uk hace 6 años
padre
commit
96e0bee87a
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. +6
    -0
      lark/utils.py

+ 6
- 0
lark/utils.py Ver fichero

@@ -71,6 +71,12 @@ def inline_args(f):
def _f(self, args):
return f.__func__(self, *args)
return _f
elif isinstance(f, functools.partial):
# wraps does not work for partials in 2.7: https://bugs.python.org/issue3445
# @functools.wraps(f)
def _f(self, args):
return f(*args)
return _f
else:
@functools.wraps(f.__call__.__func__)
def _f(self, args):


Cargando…
Cancelar
Guardar