Skip to content

bpo-42557: importable asyncio.__main__ with preamble feature #24055

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

Closed
wants to merge 5 commits into from

Conversation

lschoe
Copy link

@lschoe lschoe commented Jan 2, 2021

Making asyncio.main importable for easy customization of async REPL.
Also, function main(preamble=()) lets one specify a few lines of code that
will be executed at the start of the REPL, after importing asyncio.

This way developers of packages building on asyncio can create their own
main.py with a simple call to asyncio.main.main().

https://bugs.python.org/issue42557

Making asyncio.__main__ importable for easy customization of async REPL.
Also, function main(preamble=()) lets one specify a few lines of code that will be executed at the start of the REPL, after importing asyncio.
This way developers of packages building on asyncio can create their own __main__.py with a simple call to asyncio.__main__.main().
@github-actions
Copy link

github-actions bot commented Feb 2, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Feb 2, 2021
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Aug 2, 2022
Copy link
Member

@gvanrossum gvanrossum left a 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 we really want to be in the business of supporting this code. If you think it's useful for others I recommend that you bundle it up in a 3rd party package and distribute it via PyPI.

@gvanrossum gvanrossum closed this Oct 12, 2022
@lschoe
Copy link
Author

lschoe commented Oct 13, 2022

OK, thx, I can live with that. Since the diff with asyncio.__main__.py is only a few lines, I think anyone interested in this solution can copy it themselves from the MPyC package which is already on PyPI and GitHub. So, I'll just leave it at plugging a link to that solution in mpyc.__main__.py.

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.

5 participants