Skip to content

Conversation

@AlexWaygood
Copy link
Member

Summary

Some small followups to #20814, after studying the latest ecosystem report on #20723 and studying the code some more:

  • Allow type[] types as the first argument to super(): there are several ecosystem projects that do that
  • Disallow GenericAlias instances as the first argument to super(): this fails at runtime
  • Add a hint if the user has annotated self with a TypeVar that doesn't have an upper bound (they probably want to add an upper bound to the TypeVar)

Test Plan

Snapshots and mdtests

@AlexWaygood AlexWaygood added bug Something isn't working ty Multi-file analysis & type inference labels Oct 13, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 13, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@github-actions
Copy link
Contributor

github-actions bot commented Oct 13, 2025

mypy_primer results

Changes were detected when running on open source projects
scipy (https://github.com/scipy/scipy)
- scipy/stats/tests/test_distributions.py:3262:21: error[invalid-super-argument] `type[invgauss_gen]` is not a valid class
- scipy/stats/tests/test_distributions.py:3467:30: error[invalid-super-argument] `type[laplace_gen]` is not a valid class
- Found 6856 diagnostics
+ Found 6854 diagnostics
No memory usage changes detected ✅

@AlexWaygood AlexWaygood force-pushed the alex/more-super-fixes branch from b3e023e to b90a522 Compare October 14, 2025 12:44
@AlexWaygood AlexWaygood enabled auto-merge (squash) October 14, 2025 12:44
@AlexWaygood AlexWaygood merged commit 9090aea into main Oct 14, 2025
40 checks passed
@AlexWaygood AlexWaygood deleted the alex/more-super-fixes branch October 14, 2025 12:48
dcreager added a commit that referenced this pull request Oct 14, 2025
…able

* dcreager/non-inferable-api:
  just the api parts
  [ty] Fix further issues in `super()` inference logic (#20843)
  [ty] Document when a rule was added (#20859)
  [ty] Treat `Callable` dunder members as bound method descriptors (#20860)
  [ty] Handle decorators which return unions of `Callable`s (#20858)
  Fix false negatives in `Truthiness::from_expr` for lambdas, generators, and f-strings (#20704)
  [ty] Rename Type unwrapping methods (#20857)
  Update `lint.flake8-type-checking.quoted-annotations` docs (#20765)
dcreager added a commit that referenced this pull request Oct 15, 2025
…nt-sets

* dcreager/non-non-inferable: (174 commits)
  [ty] Add (unused) `inferable` parameter to type property methods (#20865)
  Run macos tests on macos (#20889)
  Remove `release` CI job (#20887)
  [ty] CI: Faster ecosystem analysis (#20886)
  Remove `strip` from release profile (#20885)
  [ty] Sync vendored typeshed stubs (#20876)
  [ty] Add some completion ranking improvements (#20807)
  Improved error recovery for unclosed strings (including f- and t-strings) (#20848)
  Enable lto=fat (#20863)
  [`pyupgrade`] Extend `UP019` to detect `typing_extensions.Text` (`UP019`) (#20825)
  [`flake8-bugbear`] Omit annotation in preview fix for `B006` (#20877)
  fix(docs): Fix typo in `RUF015` description (#20873)
  [ty] Improve and extend tests for instance attributes redeclared in subclasses (#20866)
  [ty] Ignore slow seeds as a temporary measure (#20870)
  use existing method
  Remove parentheses around multiple exception types on Python 3.14+ (#20768)
  Update Black tests (#20794)
  just the api parts
  [ty] Fix further issues in `super()` inference logic (#20843)
  [ty] Document when a rule was added (#20859)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants