Skip to content

Compiler can't call *args when it doesn't know how to pull apart 'args'. #426

Open
@braxtonmckee

Description

@braxtonmckee

This test should pass, but doesnt, because when the compiler knows args as : object, it just bails on the * operator. At a minimum, it should be trying to explicitly unpack all arguments, and if it can't, should be deferring to the interpreter. Conceivably we could do better than this in cases where *args or **kwargs just get passed through directly to another function, although that's not a particularly high-value use case.

    def test_star_args_with_object(self):
        def f(*args):
            return len(args)

        @Entrypoint
        def callF(args1: object, arg2, args3: object):
            return f(*args1, arg2, *args3)

        assert callF((1, 2), 3, (4, 5, 6)) == 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    compilerIssue that does not affect the un-compiled subset of typed_python

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions