Skip to content

Possible bug: reuse of name inside a loop #18

@ahouseholder

Description

@ahouseholder

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}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions