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

Possible bug: reuse of name inside a loop #18

Open
ahouseholder opened this issue Jul 21, 2023 · 0 comments
Open

Possible bug: reuse of name inside a loop #18

ahouseholder opened this issue Jul 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ahouseholder
Copy link
Contributor

The code seems to work, but I just noticed in this segment of code that quals is both the thing being iterated over AND something that is assigned to inside the loop. That seems like a bad idea even if it isn't broken. Need to change the name inside the loop to something else.

quals = [{"pushed": f"{d1}..{d2}"} for d1, d2 in zip(start_dates, end_dates)]
print(f"Starting {len(quals)} queries", flush=True)
if page_size > 100:
raise ValueError("Github requires page_size <= 100")
gh = Github(login_or_token=labyrinth.GH_TOKEN, per_page=page_size, retry=2)
results = []
for qualifiers in quals:
check_rate_limits(gh)
quals = " ".join(f"{k}:{v}" for k, v in qualifiers.items())
qstr = f"{query} {quals}"

@ahouseholder ahouseholder added the bug Something isn't working label Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant