Skip to content

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

Open
@yakobu

Description

@yakobu

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions