Repository navigation
docs: add a B034 keyword-argument example - #641
Merged
Merged
Conversation
Add a compact Avoid/Prefer example and existing-test link. Refs PyCQA#620; documentation only. AI assistance was used to prepare the documentation and validation.
cooperlees
approved these changes
Nov 18, 2026
cooperlees
left a comment
Collaborator
There was a problem hiding this comment.
This review was written by Claude (Anthropic's AI assistant) on behalf of @cooperlees.
Thanks @jaesungkr. It's a clear, compact example that picks the exact trap B034 exists to catch.
What I checked
- The example is correct.
re.IGNORECASE == 2, so in the "Avoid" line it becomescount=2and the match stays case-sensitive. Nothing in"AAA"matches"a", so it printsAAA. The "Prefer" line printsbbb. I ran both locally. - It follows the format already used for B032 and the other documented rules:
# Avoid:/# Prefer:comments, the expected output in a trailing comment, and aMore examples:link. The linkedtests/eval_files/b034.pyexists. - The change is README-only. CI and pre-commit are green.
Optional nit: on Python 3.13+, the "Avoid" line also emits DeprecationWarning: 'count' is passed as positional argument. That backs up the rule, so a short mention could be a nice touch, but it isn't needed.
Approving.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a compact Avoid/Prefer example for B034 and a link to the existing tests.
Passing
re.IGNORECASEas the fourth positional argument tore.subsuppliescount, notflags. The example shows the resultingAAAoutput and the intendedbbboutput when usingflags=re.IGNORECASE.This only changes README documentation. It does not change the checker or its diagnostics.
Refs #620 (B034 only; this does not complete the broader examples issue).
Validation
AI assistance
I worked on the implementation and validation with assistance from AI.