[red-knot] Implicit instance attributes in generic methods#17769
Merged
[red-knot] Implicit instance attributes in generic methods#17769
Conversation
Contributor
|
sharkdp
commented
May 1, 2025
dcreager
reviewed
May 2, 2025
Member
There was a problem hiding this comment.
TIL about this directory! As an aside, do we have a convention for choosing which number to use as the prefix for the test cases in here?
Contributor
There was a problem hiding this comment.
Not really, and I think we've even added some without numbers. The numbers are legacy (we inherited this corpus) and I don't think they serve much purpose, we could just do a pass to remove them. I guess if they serve any purpose it's to keep related tests next to each other in a lexicographic ordering? But that can also just be done with naming.
dcreager
added a commit
that referenced
this pull request
May 2, 2025
* main: [red-knot] Refactor: no mutability in call APIs (#17788) [red-knot] Fix panic for `tuple[x[y]]` string annotation (#17787) [red-knot] Implicit instance attributes in generic methods (#17769) doc: Add link to `check-typed-exception` from `S110` and `S112` (#17786) Fix module name in ASYNC110, 115, and 116 fixes (#17774) [red-knot] More informative hover-types for assignments (#17762) [syntax-errors] Use consistent message for bad starred expression usage. (#17772) red_knot_server: add auto-completion MVP Allow passing a virtual environment to `ruff analyze graph` (#17743) Bump 0.11.8 (#17766) [`flake8-use-pathlib`] Fix `PTH104`false positive when `rename` is passed a file descriptor (#17712)
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
Add the ability to detect instance attribute assignments in class methods that are generic.
This does not address the code duplication mentioned in #16928. I can open a ticket for this after this has been merged.
closes #16928
Test Plan
Added regression test.