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 — Add asyncio.taskgroups and new Task methods by gvanrossum · Pull Request #7240 · python/typeshed

Conversation

@gvanrossum

@gvanrossum gvanrossum commented Feb 16, 2022

Copy link
Copy Markdown
Member

The new Task methods are .cancelling() and .uncancel().

Everything is conditional to 3.11 (but the taskgroups.py module
always exists -- it's just empty before 3.11).

Sorry, something went wrong.

Uh oh!

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

All reactions
gvanrossum and others added 3 commits February 16, 2022 10:34
@gvanrossum
Add asyncio.taskgroups and new Task methods
9833b03
The new Task methods are .cancelling() and .uncancel().

Everything is conditional to 3.11 (but the taskgroups.py module
always exists -- it's just empty before 3.11).
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
f080a41
@gvanrossum
Make default value '...'
c3e6ff6
@github-actions

This comment has been minimized.

Sign in to view
1 similar comment
@github-actions

This comment has been minimized.

Sign in to view
gvanrossum added 2 commits February 16, 2022 10:54
@gvanrossum
Add explicit return type for __init__()
84a0f30
@gvanrossum
Import TaskGroup into toplevel asyncio
e94e699
@gvanrossum

gvanrossum commented Feb 16, 2022

Copy link
Copy Markdown
Member Author

Question for other typeshed maintainers. How do we handle modules that were added in a certain release? I am getting errors from the linters that seem to be complaining about this.

(@srittau @JelleZijlstra )

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

This comment has been minimized.

Sign in to view
1 similar comment
@github-actions

This comment has been minimized.

Sign in to view
@JelleZijlstra

JelleZijlstra commented Feb 16, 2022

Copy link
Copy Markdown
Member

You need to add it to the VERSIONS file, https://github.com/python/typeshed/blob/master/stdlib/VERSIONS

All reactions

Sorry, something went wrong.

Uh oh!

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

JelleZijlstra
JelleZijlstra reviewed Feb 16, 2022
View reviewed changes
Comment thread stdlib/asyncio/taskgroups.pyi Resolved

Uh oh!

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

gvanrossum and others added 2 commits February 16, 2022 11:40
@gvanrossum @JelleZijlstra
Make __aenter__/__aexit__ async!
d238676
(Thanks Jelle...)

Co-authored-by: Jelle Zijlstra <[email protected]>
@gvanrossum
Update stdlib/VERSIONS file
66e7fa2
@github-actions

This comment has been minimized.

Sign in to view
1 similar comment
@github-actions

This comment has been minimized.

Sign in to view
@gvanrossum
Use 'import X as X' idiom
767c264
@github-actions

This comment has been minimized.

Sign in to view
@gvanrossum

gvanrossum commented Feb 16, 2022

Copy link
Copy Markdown
Member Author

These test failures are excruciating if you haven't been following developments here. :-)

I now get "error: asyncio.taskgroups failed to find stubs" e.g. https://github.com/python/typeshed/runs/5222298476?check_suite_focus=true

I'm not sure what it's telling me I have to do. :-(

All reactions

Sorry, something went wrong.

Uh oh!

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

@Akuli

Akuli commented Feb 16, 2022

Copy link
Copy Markdown
Collaborator

stubtest is a tool that imports the module and compares it to stubs. Because asyncio.taskgroups can't actually be imported before 3.11, you need to suppress the error by adding a line asyncio.taskgroups to py36.txt, py37.txt etc in tests/stubtest_allowlists/.

gvanrossum 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.

@gvanrossum
Update stubtest allowlists
baab662
@JelleZijlstra

JelleZijlstra commented Feb 16, 2022

Copy link
Copy Markdown
Member

I suppose we should make stubtest understand the VERSIONS file.

Akuli 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.

@github-actions

This comment has been minimized.

Sign in to view
Akuli
Akuli reviewed Feb 16, 2022
View reviewed changes

@Akuli Akuli left a comment

Copy link
Copy Markdown
Collaborator

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.

A few comments below. Unfortunately our CI isn't very helpful, because we don't run the tests on Python 3.11 yet.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread stdlib/asyncio/taskgroups.pyi Resolved

Uh oh!

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

Comment thread stdlib/asyncio/taskgroups.pyi Resolved

Uh oh!

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

Comment thread stdlib/asyncio/taskgroups.pyi Resolved

Uh oh!

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

Comment thread stdlib/asyncio/taskgroups.pyi Resolved

Uh oh!

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

@AlexWaygood

AlexWaygood commented Feb 16, 2022

Copy link
Copy Markdown
Member

I suppose we should make stubtest understand the VERSIONS file.

I believe that should already be fixed in the next version of mypy (python/mypy#12083)

All reactions

Sorry, something went wrong.

Uh oh!

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

gvanrossum and others added 2 commits February 16, 2022 13:10
@gvanrossum
Remove version check from taskgroups.pyi; fix __aexit__ signature
bc3cd0e
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
99883fb
Akuli
Akuli reviewed Feb 16, 2022
View reviewed changes
Comment thread stdlib/asyncio/taskgroups.pyi Resolved

Uh oh!

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

@github-actions

This comment has been minimized.

Sign in to view
@gvanrossum
Get rid of name arg (it doesn't exist)
634bf7d
@github-actions

This comment has been minimized.

Sign in to view
gvanrossum and others added 3 commits February 16, 2022 14:10
@gvanrossum
The name arg on __init__ is kw-only
7dfbc6c
@gvanrossum
Use Self typevar for __aenter__
2df795b
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
969eb9c
@github-actions

This comment has been minimized.

Sign in to view
1 similar comment
@github-actions

github-actions Bot commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

All reactions

Sorry, something went wrong.

Uh oh!

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

Akuli
Akuli approved these changes Feb 16, 2022
View reviewed changes
@Akuli
Akuli merged commit 35bddd2 into master Feb 16, 2022
@Akuli
Akuli deleted the taskgroups branch February 16, 2022 22:32
@gvanrossum

gvanrossum commented Feb 16, 2022

Copy link
Copy Markdown
Member Author

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@gvanrossum gvanrossum mentioned this pull request Feb 16, 2022
Introduce task groups to asyncio and change task cancellation semantics python/cpython#90908
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra left review comments
@Akuli Akuli Akuli approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

4 participants

@gvanrossum @JelleZijlstra @Akuli @AlexWaygood
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 01402503 — 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.