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

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

Open
braxtonmckee opened this issue Jan 30, 2023 · 0 comments
Labels
compiler Issue that does not affect the un-compiled subset of typed_python

Comments

@braxtonmckee
Copy link
Collaborator

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
@braxtonmckee braxtonmckee added the compiler Issue that does not affect the un-compiled subset of typed_python label Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Issue that does not affect the un-compiled subset of typed_python
Projects
None yet
Development

No branches or pull requests

1 participant