Ver a proveniência

Merge pull request #102 from night199uk/functools

Allow functools partials to be used with the InlineTransformer
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.5.6
Erez Shinan há 6 anos
committed by GitHub
ascendente
cometimento
52d4ce2990
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: 4AEE18F83AFDEB23
1 ficheiros alterados com 6 adições e 0 eliminações
  1. +6
    -0
      lark/utils.py

+ 6
- 0
lark/utils.py Ver ficheiro

@@ -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):


Carregando…
Cancelar
Guardar