question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v_args decorator calls FunctionType function with self.

See original GitHub issue

When decorating a Transformer with v_args, the decorated functions are called with self even for non-method.

The last parameter at this line should be False, isn’t it? https://github.com/lark-parser/lark/blob/master/lark/utils.py#L63

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
erezshcommented, Oct 15, 2018

Btw, if you want to write a test encompassing all the possibilities (method, static, clsmethod, lambda, etc.) that would be great.

0reactions
guydcommented, Oct 17, 2018

Great. Thanks again. I will git it a try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - How to create a decorator that can be used either ...
An alternative method is just to require that the decorator function is always called, even if it is with no arguments. In this...
Read more >
Function Decorators — wrapt 1.13.0rc2 documentation
Only the arguments following on from the self argument will be a part of args. When calling the wrapped function in the decorator...
Read more >
Primer on Python Decorators
Decorators provide a simple syntax for calling higher-order functions. By definition, a decorator is a function that takes another function and extends the ......
Read more >
LLVM Language Reference Manual
This calling convention supports varargs function calls and tolerates some mismatch ... with different parameter attributes can have the same function type.
Read more >
Source code for param.parameterized - HoloViz
__self__ if sys.version_info.major >= 3 else method.im_self ... [docs]def as_uninitialized(fn): """ Decorator: call fn with the parameterized_instance's ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found