Skip to content
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

Add yield support in async function #14331

Open
3 of 5 tasks
m24h opened this issue Apr 19, 2024 · 1 comment
Open
3 of 5 tasks

Add yield support in async function #14331

m24h opened this issue Apr 19, 2024 · 1 comment

Comments

@m24h
Copy link

m24h commented Apr 19, 2024

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues regarding this feature, and didn't find any.

Description

Just in PEP 525, it's really easy to make a async generator instead of coding a new class with aiter and anext .

Just like this:

async def test():
   for i in range(5):
      await something
'     yield i

Code Size

I believe this is an important syntax that makes asynchronous generation as convenient as normal generators.

Implementation

  • I intend to implement this feature and would submit a Pull Request if desirable.
  • I hope the MicroPython maintainers or community will implement this feature.
  • I would like to Sponsor development of this feature.
@dpgeorge
Copy link
Member

An initial implementation of PEP 525 is given in #6668.

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

No branches or pull requests

2 participants