Skip to content

gh-110209: Add __class_getitem__ for generator and coroutine #110212

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 7 commits into from
May 7, 2024

Conversation

Gobot1234
Copy link
Contributor

@Gobot1234 Gobot1234 commented Oct 2, 2023

@Gobot1234
Copy link
Contributor Author

Windows failure seems unrelated

Copy link
Contributor

@graingert graingert left a comment

Choose a reason for hiding this comment

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

Can you add a test for this?

@JelleZijlstra
Copy link
Member

Do we also need to do this for async generators? (Will look more later today but don't have a ton of time right now.)

@JelleZijlstra
Copy link
Member

Do we also need to do this for async generators? (Will look more later today but don't have a ton of time right now.)

No, async generators are already subscriptable.

>>> x = type(f())
>>> 
>>> x
<class 'async_generator'>
>>> x[1]
async_generator[1]
>>> 

@JelleZijlstra JelleZijlstra merged commit e7dafdc into python:main May 7, 2024
38 checks passed
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