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

unnecessary-indexing runtime error #699

Closed
david-yz-liu opened this issue May 26, 2021 · 0 comments · Fixed by #712
Closed

unnecessary-indexing runtime error #699

david-yz-liu opened this issue May 26, 2021 · 0 comments · Fixed by #712
Assignees

Comments

@david-yz-liu
Copy link
Contributor

The UnnecessaryIndexingChecker raises a runtime error on the following code:

def f(lst: list) -> None:
    i = 0
    for i in range(len(lst)):
        if lst[0]:
            i = 1
        else:
            i = 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants