[ty] Fix method calls on subclasses of Any#23248
Conversation
Typing conformance results improved 🎉The percentage of diagnostics emitted that were expected errors increased from 83.51% to 83.59%. The percentage of expected errors that received a diagnostic held steady at 74.33%. Summary
False positives removedDetails
|
Memory usage reportSummary
Significant changesClick to expand detailed breakdownflake8
trio
sphinx
prefect
|
|
3a98765 to
f0368c8
Compare
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-argument-type |
0 | 8 | 112 |
invalid-method-override |
41 | 0 | 0 |
unresolved-attribute |
4 | 0 | 32 |
invalid-return-type |
0 | 3 | 10 |
unsupported-operator |
0 | 0 | 8 |
invalid-assignment |
0 | 0 | 7 |
not-iterable |
0 | 0 | 4 |
type-assertion-failure |
1 | 0 | 2 |
unused-type-ignore-comment |
0 | 3 | 0 |
| Total | 46 | 14 | 175 |
|
The diagnostics going away on
So, chalk this up as another win for the theory that "the gradual guarantee is really hard, and more precise type inference often actually leads to fewer false positives overall" |
|
And similar for the diagnostics going away on |
AlexWaygood
left a comment
There was a problem hiding this comment.
Love it! You could possibly include some of the examples from #23248 (comment) and #23248 (comment) as tests too, to demonstrate that this stricter type inference also fixes false positives that could otherwise arise 😃
Thank you for the analysis. I agree that it's cool to see these diagnostics go away, but both scenarios seem a bit too convoluted to serve as great unit tests, IMO. Merging without these for now. |
* main: (209 commits) [ty] Defer base inference for functional `type(...)` classes (#22792) flake8-executable: allow global flags in uv shebangs (EXE003) (#22582) [ty] Add `replace-imports-with-any` option (#23122) Update html comments in mdtests (#23269) Apply ruff formatting to mdtests (#22935) [ty] Exclude test-related symbols from non-first-party packages in auto-import completions [ty] Refactor `CursorTest` helper to support site-packages [ty] Qualify inlay hint edit symbol when possibly referencing another variable (#23265) [ty] Avoid `UnionBuilder` overhead when creating a new union from the filtered elements of an existing union (#22352) [ty] Refactor TypedDict key assignment validation (#23262) [ty] Improve Python environment path documentation (#23256) [ty] loop control flow analysis using loop header definitions Prepare for 0.15.1 (#23253) Remove docker-run-action (#23254) [ty] Allow discovering dependencies in system Python environments (#22994) Ensure pending suppression diagnostics are reported (#23242) [`isort`] support for configurable import section heading comments (#23151) [ty] Fix method calls on subclasses of `Any` (#23248) [ty] Fix bound method access on `None` (#23246) Make range suppression test snapshot actually useful (#23251) ...
Summary
Another small win in terms of typing conformance. This should fix the last remaining test in
specialtypes_any.pyEcosystem
The new diagnostics look like true positives (in our current strict interpretation of LSP checks)
Test Plan
New Markdown test