GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer by srittau · Pull Request #133894 · python/cpython

Conversation

@srittau

@srittau srittau commented May 11, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

  • Issue: asyncio.graph.format_call_graph() should use io.Writer instead of typing.TextIO #133893

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@srittau
asyncio.graph: Replace TextIO annotation with io.Writer
0e19da0
@srittau
srittau requested review from 1st1, asvetlov, kumaraditya303 and willingc as code owners May 11, 2025 11:52
@bedevere-app bedevere-app Bot mentioned this pull request May 11, 2025
asyncio.graph.format_call_graph() should use io.Writer instead of typing.TextIO #133893
Closed
@bedevere-app bedevere-app Bot added the awaiting review label May 11, 2025
@srittau
Fix linter complaint
0410644
@srittau srittau mentioned this pull request May 11, 2025
Add asyncio.graph, updates to asyncio.futures (3.14) python/typeshed#14003
Merged
@srittau
Fix func reference in NEWS
e3a14e5
sobolevn
sobolevn reviewed May 11, 2025
View reviewed changes

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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! 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@srittau
Remove NEWS entry
a6570d7
JelleZijlstra
JelleZijlstra reviewed May 11, 2025
View reviewed changes
Comment thread Lib/asyncio/graph.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@srittau
Unlazify
6fcd632
@JelleZijlstra JelleZijlstra added the skip news label May 11, 2025
JelleZijlstra
JelleZijlstra approved these changes May 11, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels May 11, 2025
sobolevn
sobolevn approved these changes May 11, 2025
View reviewed changes

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sobolevn
sobolevn merged commit 1d3eace into python:main May 11, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label May 11, 2025
@sobolevn sobolevn added awaiting merge needs backport to 3.14 bugs and security fixes labels May 11, 2025
@miss-islington-app

miss-islington-app Bot commented May 11, 2025

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 11, 2025
@srittau @miss-islington
pythongh-133893: asyncio.graph: Replace TextIO annotation with io.Wri…
ca56b22
…ter (pythonGH-133894)

(cherry picked from commit 1d3eace)

Co-authored-by: Sebastian Rittau <[email protected]>
@bedevere-app

bedevere-app Bot commented May 11, 2025

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

sobolevn commented May 11, 2025

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@srittau
srittau deleted the print-graph branch May 11, 2025 15:17
@srittau

srittau commented May 11, 2025

Copy link
Copy Markdown
Contributor Author

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.

sobolevn reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra

JelleZijlstra commented May 11, 2025

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn pushed a commit that referenced this pull request May 11, 2025
@miss-islington @srittau
[3.14] gh-133893: asyncio.graph: Replace TextIO annotation with io.Wr…
507715d
…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 <[email protected]>
@sobolevn

sobolevn commented May 11, 2025

Copy link
Copy Markdown
Member

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

It might be a reference for future work.

srittau reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@srittau @Pranjal095
pythongh-133893: asyncio.graph: Replace TextIO annotation with io.Wri…
71f0841
…ter (python#133894)
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@srittau @taegyunkim
pythongh-133893: asyncio.graph: Replace TextIO annotation with io.Wri…
cf1e122
…ter (python#133894)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes
@sobolevn sobolevn sobolevn approved these changes
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner
@kumaraditya303 kumaraditya303 Awaiting requested review from kumaraditya303 kumaraditya303 is a code owner
@willingc willingc Awaiting requested review from willingc willingc is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting merge skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@srittau @sobolevn @JelleZijlstra
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.