Skip to content

AI-generated possible solution for #545 (B)#556

Closed
hugnia wants to merge 1 commit into
PyCQA:mainfrom
hugnia:routing-preference/issue-545/solution-b
Closed

AI-generated possible solution for #545 (B)#556
hugnia wants to merge 1 commit into
PyCQA:mainfrom
hugnia:routing-preference/issue-545/solution-b

Conversation

@hugnia
Copy link
Copy Markdown

@hugnia hugnia commented May 26, 2026

Hi,

We're a research team at JetBrains studying how maintainers evaluate AI-generated code.

We opened two pull requests as possible solutions to the corresponding issue, each taking a different approach. Both were generated by AI and have not yet been manually reviewed by a human. We’d like to get your perspective on these two solutions via a 10-minute survey. Regardless of your role, we want to know which solution actually saves you work, and which qualities of AI-generated code matter most when working with the codebase.

If you're open to participating in our study, just reply "I'm interested" here, and we'll send the details to the contact specified in your GitHub profile. If you'd rather not take part, feel free to close the PRs – we won’t post them again.

Thanks!

Issue #545

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new optional Bugbear rule, B913, intended to warn about zip() loop variables discarded with trailing _ targets.

Changes:

  • Invokes a new B913 check from visit_For.
  • Adds check_for_b913 to detect trailing unused _ targets in for ... in zip(...).
  • Registers B913 as an error code disabled by default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bugbear.py
) and not any(kw.arg == "strict" for kw in node.keywords):
self.add_error("B911", node)

def check_for_b913(self, node: ast.For) -> None:
Comment thread bugbear.py
Comment on lines +1965 to +1967
if len(call.args) != len(target_elts):
return
self.add_error("B913", node)
@cooperlees
Copy link
Copy Markdown
Collaborator

cooperlees commented May 29, 2026

I generally get AI to review, then sanity check code. Here I'd love some unittests please showing the check works and finds lint errors with all examples of everything it can fire on please. I think I prefer this being an optional check, so let's for with this PR.

Please also address copilot's findings.

@hugnia
Copy link
Copy Markdown
Author

hugnia commented Jun 2, 2026

Thank you so much for taking the time to review this PR and share your feedback — we genuinely appreciate it!

I should have made this clearer upfront: as mentioned in our initial message, both PRs were submitted as part of a research study on how maintainers evaluate AI-generated code. They are not intended for actual merging, and we will not be able to refine or update them. We are sorry for any confusion this caused — your time is valuable. If you would like to participate in the study and share your thoughts on the two solutions, we would love to hear from you. Otherwise, please feel free to close the PRs.

@cooperlees
Copy link
Copy Markdown
Collaborator

cooperlees commented Jun 2, 2026

Yeah, that was not clear. Please improve that for others as we as maintainers have limited time and you've now taken mine for no advantage to this project. That makes me sad.

@cooperlees cooperlees closed this Jun 2, 2026
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.

3 participants