Repository navigation
[flake8-pyi] Note that PYI051 is an opinionated stylistic rule - #26179
Merged
Merged
Conversation
ntBre
reviewed
Jun 22, 2026
| /// that `Literal`. | ||
| /// | ||
| /// ## Why is this bad? | ||
| /// This rule is opinionated and stylistic. It treats type-checking behavior as |
Contributor
There was a problem hiding this comment.
This seems much too prominent to me. This would put the disclaimer at the very top of the rule docs. I'd probably put a mention of the pedantic nature at the very end in a ## Known issues section or similar.
ntBre
enabled auto-merge (squash)
June 23, 2026 18:35
ntBre
disabled auto-merge
June 23, 2026 18:35
flake8-pyi] Note that PYI051 is an opinionated stylistic rule
ntBre
enabled auto-merge (squash)
June 23, 2026 18:36
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.
Summary
Clarifies the PYI051 documentation to describe the rule as opinionated and stylistic.
The added text explains that the rule focuses on type-checking behavior, while acknowledging cases where projects may intentionally keep
Literalmembers for editor suggestions, generated documentation, or other non-type-checking purposes.Validation
mainversiongit diff --no-index --checkFixes #23134