Skip to content

Add support for async generators (PEP525) #6668

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dpgeorge
Copy link
Member

@dpgeorge dpgeorge commented Dec 2, 2020

Very basic support for PEP525, can create and iterate through async generators (no support yet for aclose/athrow/asend).

@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label Dec 2, 2020
@dpgeorge dpgeorge force-pushed the py-async-generators branch from 5907913 to 62588a1 Compare December 2, 2020 11:27
@dpgeorge dpgeorge mentioned this pull request Oct 28, 2021
53 tasks
tannewt added a commit to tannewt/circuitpython that referenced this pull request Aug 3, 2022
* Tweak scroll area position so last line is complete and top is
  under the title bar.
* Pick Blinka size based on the font to minimize unused space in
  title bar. Related to micropython#2791
* Update the title bar after terminal is started. Fixes micropython#6078

Fixes micropython#6668
tannewt added a commit to tannewt/circuitpython that referenced this pull request Aug 3, 2022
* Tweak scroll area position so last line is complete and top is
  under the title bar.
* Pick Blinka size based on the font to minimize unused space in
  title bar. Related to micropython#2791
* Update the title bar after terminal is started. Fixes micropython#6078

Fixes micropython#6668
tannewt added a commit to tannewt/circuitpython that referenced this pull request Aug 4, 2022
* Tweak scroll area position so last line is complete and top is
  under the title bar.
* Pick Blinka size based on the font to minimize unused space in
  title bar. Related to micropython#2791
* Update the title bar after terminal is started. Fixes micropython#6078

Fixes micropython#6668
Very basic support for PEP525, can create and iterate through async
generators (no support yet for aclose/athrow/asend).

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the py-async-generators branch from 62588a1 to ae5b21a Compare December 15, 2022 02:26
@dpgeorge dpgeorge changed the title WIP: add support for async generators (PEP525) Add support for async generators (PEP525) Dec 15, 2022
@dpgeorge
Copy link
Member Author

This requires a bump in the .mpy version due to the new scope flag MP_SCOPE_FLAG_ASYNCGENERATOR.

@github-actions
Copy link

Code size report:

   bare-arm:   +20 +0.035% 
minimal x86:   +16 +0.010% 

@dpgeorge
Copy link
Member Author

This comment may be worth considering in our implementation of async generators: faster-cpython/ideas#570 (comment)

@projectgus
Copy link
Contributor

This is an automated heads-up that we've just merged a Pull Request
that removes the STATIC macro from MicroPython's C API.

See #13763

A search suggests this PR might apply the STATIC macro to some C code. If it
does, then next time you rebase the PR (or merge from master) then you should
please replace all the STATIC keywords with static.

Although this is an automated message, feel free to @-reply to me directly if
you have any questions about this.

@ShadowLNC
Copy link

Conflicts notwithstanding, is it possible to merge this please @dpgeorge ? I have a use case and I'm already compiling MicroPython locally, so I'd be happy to try out the branch (once synced) if that helps.

@robert-hh
Copy link
Contributor

@ShadowLNC You can get that PR to your PC and try it locally. It does not have to be merged to the master branch for doing that. The sequence would be, assuming that origin the reference to the MicroPyhton repository:

git fetch origin pull/6668/head:async_generator
git checkout async_generator

The you have that PR local as branch async_generator. Since it is quite old, it will most likely not compile. You have to make the appropriate fixes, like changing STATIC into static. Maybe more.

@AmirHmZz
Copy link
Contributor

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
py-core Relates to py/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants