Skip to content

gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer #133894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 11, 2025

Conversation

srittau
Copy link
Contributor

@srittau srittau commented May 11, 2025

Considering that this is a new module in 3.14, I think this should be backported.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

I don't think that news entry should be added here, there's no user-visible change.

Other than that - LGTM! 👍

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thank you!

@sobolevn sobolevn merged commit 1d3eace into python:main May 11, 2025
44 checks passed
@miss-islington-app
Copy link

Thanks @srittau for the PR, and @sobolevn for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 11, 2025
…ter (pythonGH-133894)

(cherry picked from commit 1d3eace)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
@bedevere-app
Copy link

bedevere-app bot commented May 11, 2025

GH-133901 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 11, 2025
@sobolevn
Copy link
Member

@srittau @JelleZijlstra do know how we can type-check this file and several others in Lib/asyncio/? It might be a good idea. Depending on how complex the setup will be.

@srittau srittau deleted the print-graph branch May 11, 2025 15:17
@srittau
Copy link
Contributor Author

srittau commented May 11, 2025

Type checking in the standard library has been a contentious issue, see for example https://discuss.python.org/t/type-annotations-in-the-stdlib/21487/2

I personally think that all annotated code in the standard library should be type checked, but this is probably a PEP-level problem that will cause a lot of pushback.

@JelleZijlstra
Copy link
Member

There's also practical issues because type checkers assume standard library code is in typeshed. @ambv talked on the core.py podcast recently about how they achieved type checking for pyrepl with some symlink trick; but pyrepl might be a slightly easier case because it's private and not in typeshed.

sobolevn pushed a commit that referenced this pull request May 11, 2025
…iter (GH-133894) (#133901)

gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (GH-133894)
(cherry picked from commit 1d3eace)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
@sobolevn
Copy link
Member

I already sneaked into tomllib type-checking, see: #133118

It might be a reference for future work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants