-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[red-knot] Add support for calling type[…]
#16597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
type[<dynamic base>]
fe532b6
to
40aaf41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff in the mypy_primer run looks great! It's unfortunate that it shows up as a "failed check" on the PR, though -- is that deliberate?
40aaf41
to
fc07a1c
Compare
Signalling a non-empty diff as a 'failure' (that you need to look at) seems fine to me? Once we add commenting on PRs, we could potentially turn that into a check that always succeeds. |
type[<dynamic base>]
type[…]
hmm, I suspect this will be quite confusing for new contributors. Though having said that, contributors have also been confused over at typeshed by the mypy_primer comments. (A "sea of red" in the comment can be a good thing, since it shows that diagnostics are going away! But red usually connotes "bad" 😄) |
# TODO: Those should all be errors | ||
reveal_type(subclass_of_c("a")) # revealed: C | ||
reveal_type(subclass_of_c()) # revealed: C | ||
reveal_type(subclass_of_c(1, 2)) # revealed: C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will be fixed by #16512
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think overall I'd much prefer a "comment on the PR" mypy_primer check rather than have the check fail. But the changes this PR makes look great!
Ok, I'll look into it. |
* main: [red-knot] Add support for calling `type[…]` (#16597) Update migration guide with the new `ruff.configuration` (#16567) [red-knot] Add 'mypy_primer' workflow (#16554) Update Rust crate indoc to v2.0.6 (#16585) Update Rust crate syn to v2.0.100 (#16590) Update Rust crate thiserror to v2.0.12 (#16591) Update Rust crate serde_json to v1.0.140 (#16589) Update Rust crate quote to v1.0.39 (#16587) Update Rust crate serde to v1.0.219 (#16588) Update Rust crate proc-macro2 to v1.0.94 (#16586) Update Rust crate anyhow to v1.0.97 (#16584) Update dependency ruff to v0.9.10 (#16593) Update Rust crate unicode-ident to v1.0.18 (#16592) [red-knot] Do not ignore typeshed stubs for 'venv' module (#16596) [red-knot] Reduce Salsa lookups in `Type::find_name_in_mro` (#16582) Fix broken red-knot property tests (#16574) [red-knot] Consistent spelling of "metaclass" and "meta-type" (#16576)
Summary
This fixes the non-diagnostics part of #15948, but is mostly an experiment to see if the new ecosystem checks work as intended (see failing mypy primer run here). I saw a few false positives when expressions of type
type[<dynamic base>]
were called, so this seemed rather easy to fix.Test Plan
New Markdown tests.
Negative diff on the ecosystem checks: