Skip to content

Fix GenericPrefetch invariance with QuerySet#3380

Merged
UnknownPlatypus merged 1 commit into
typeddjango:masterfrom
pmdevita:bug/generic-prefetch-invariance
May 12, 2026
Merged

Fix GenericPrefetch invariance with QuerySet#3380
UnknownPlatypus merged 1 commit into
typeddjango:masterfrom
pmdevita:bug/generic-prefetch-invariance

Conversation

@pmdevita

Copy link
Copy Markdown
Contributor

I have made things!

_PrefetchedQuerySetsT, the type used for GenericPrefetch's querysets arg is bound to list[QuerySet], making it invariant and causing it to fail with QuerySet subclasses.

I have changed this type to Sequence[QuerySet], which should fix this issue.

Related issues

No issue is currently filed for this.

AI Policy

  • I have read and agree to the AI Policy, removed any "Co-Authored-By" lines attributing coding agents, and manually reviewed the final result

@UnknownPlatypus UnknownPlatypus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!

@UnknownPlatypus UnknownPlatypus merged commit 18413d5 into typeddjango:master May 12, 2026
54 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants