Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*args after transformation is considerd as a required positional argument #67

Open
yakobu opened this issue Jul 7, 2018 · 1 comment · May be fixed by #68
Open

*args after transformation is considerd as a required positional argument #67

yakobu opened this issue Jul 7, 2018 · 1 comment · May be fixed by #68
Labels

Comments

@yakobu
Copy link

yakobu commented Jul 7, 2018

for example:

from codetransformer import CodeTransformer, pattern
from codetransformer.instructions import CALL_FUNCTION

def add(*args):
    return sum([*args])

class EmptyTransformer(CodeTransformer):
    @pattern(CALL_FUNCTION)
    def _call(self, call):
         yield call

transformer = EmptyTransformer()

new_add = transformer(add)

add() => 0
new_add() => TypeError: add() missing 1 required positional argument: 'args'
@llllllllll
Copy link
Owner

Good find, it looks like we messed up how we represented this information between our Code object and the transformer.

I opened a PR to fix this here: #68

@llllllllll llllllllll added the bug label Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants