Skip to content

Special-case constructor for tuple types#21502

Merged
ilevkivskyi merged 1 commit into
python:masterfrom
ilevkivskyi:tuple-sub-constructor
May 19, 2026
Merged

Special-case constructor for tuple types#21502
ilevkivskyi merged 1 commit into
python:masterfrom
ilevkivskyi:tuple-sub-constructor

Conversation

@ilevkivskyi
Copy link
Copy Markdown
Member

Fixes #19106

Tuple constructor is quite imprecise, and I don't think we can get anything decent without some special-casing, so I am doing just that, adding one more special_sig.

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi
Copy link
Copy Markdown
Member Author

@JukkaL @hauntsaninja This is a simple change, if there are no objections I will be merging this tomorrow.

@ilevkivskyi ilevkivskyi merged commit b44b2ca into python:master May 19, 2026
25 checks passed
@ilevkivskyi ilevkivskyi deleted the tuple-sub-constructor branch May 19, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

incorrect inference of user-defined variadic tuple subtype instances

2 participants