Skip to content

Add implicit module dependency if using t-string#20900

Merged
JukkaL merged 6 commits intomasterfrom
tstring-2
Feb 25, 2026
Merged

Add implicit module dependency if using t-string#20900
JukkaL merged 6 commits intomasterfrom
tstring-2

Conversation

@JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Feb 25, 2026

If a file uses t-strings, implicitly depend on string.templatelib.

Also improve test coverage a bit.

Follow-up to #20850.

@JukkaL JukkaL requested a review from ilevkivskyi February 25, 2026 16:03
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

LG

@github-actions
Copy link
Contributor

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

@ilevkivskyi
Copy link
Member

Btw the same test fails on master. So it is not your PR, likely this fix is incomplete however.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Feb 25, 2026

I'll merge this for now and investigate the failure afterwards.

@JukkaL JukkaL merged commit 96e4916 into master Feb 25, 2026
23 of 24 checks passed
@JukkaL JukkaL deleted the tstring-2 branch February 25, 2026 16:40
@ilevkivskyi
Copy link
Member

@JukkaL just in case it will be helpful, a while ago when I had a similar problem I added this https://github.com/python/mypy/blob/master/test-data/unit/lib-stub/typing_extensions.pyi#L1-L3 IIRC the problem was caused by how we resolve stdlib modules when we run our tests.

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.

2 participants