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

Add support for looping over empty tuples #7454

Closed
kc611 opened this issue Oct 2, 2021 · 2 comments
Closed

Add support for looping over empty tuples #7454

kc611 opened this issue Oct 2, 2021 · 2 comments

Comments

@kc611
Copy link
Collaborator

kc611 commented Oct 2, 2021


Feature request

import numba

@numba.njit
def test():
    a = ((1, 2),)
    b = ()
    c= (1,)

    # Works
    for i in c:
        print(i)

    for i, j in a:
        print(i+j)

    # Fails due to type error
    for i in b:
        print(i)

    for i, j in b:
        print(i+j)

test()

In general, there doesn't seem to be an way to iterate over empty tuples in Numba. For instance, we might not know if the element being iterated over is empty or not.

@esc
Copy link
Member

esc commented Oct 4, 2021

@kc611 thank you for reporting this. I seems like a duplicate of: #7245

@stuartarchibald
Copy link
Contributor

@kc611 Thanks for opening the request. Am going to close this as it's a duplicate as noted. Perhaps consider subscribing to #7245 to get updates on any progress made? Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants