Skip to content

Conversation

@gvanrossum
Copy link
Collaborator

@gvanrossum gvanrossum commented Dec 29, 2025

  • Fixed 23 unused variable errors.
    • This found a bug in answers.py: if N answers present, we'd add N copies of each of the generated answers, due to an unnecessary double loop. What was I thinking?
  • Fixed 177 unused import errors.
  • Fixed 1 duplicate import error.
  • Renamed fixtures.py to conftest.py and remove most imports referencing it from the tests (fixtures defined in conftest.py are implicitly available in all tests).

I used AI (mostly Claude Opus 4.5) for this but reviewed everything it did and occasionally tweaked it (this is how I found the double loop in answers.py).

This found a bug in answers.py: if N answers present, we'd add N copies of each of the generated answers
@gvanrossum gvanrossum changed the title Make pyright error on unused variables Make pyright error on unused variables and imports Dec 29, 2025
@gvanrossum
Copy link
Collaborator Author

The 'make format' failures are spurious -- I don't know what causes them (maybe black version skew?) and they don't happen on my Mac. The change looks harmless and not something that should trigger a reformat.

@robgruen this is ready for your review now.

@gvanrossum gvanrossum requested a review from robgruen December 29, 2025 20:11
@gvanrossum gvanrossum merged commit 43c6a00 into main Dec 29, 2025
11 of 15 checks passed
@gvanrossum gvanrossum deleted the unusedvars branch December 29, 2025 20:28
@gvanrossum
Copy link
Collaborator Author

The 'make format' failures are spurious

No they weren't. There was a formatting issue in tools/get_keys.py due to the added warning -- black wants it formatted like this:

        self.credential = (
            DefaultAzureCredential()
        )  # CodeQL [SM05139] - This code is used as part of development setup only.

I'm not sure if CodeQL is smart enough to honor that. Instead we should probably add # fmt: skip to the end of the line, or surround it with # fmt: off / # fmt: on .

@robgruen

@robgruen
Copy link
Collaborator

I agree with you about CodeQL I'll make that change.

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 this pull request may close these issues.

4 participants