← 输入框|github.com|刷新
Skip to content

Support AutoAwait? #80609

Closed
Closed

Description

@gvanrossum
BPO 36428
Nosy @gvanrossum, @asvetlov, @1st1, @tirkarthi
Superseder
  • bpo-34616: implement "Async exec"
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-03-26.00:05:56.013>
    created_at = <Date 2019-03-25.23:49:29.315>
    labels = ['interpreter-core', '3.8', 'expert-asyncio']
    title = 'Support AutoAwait?'
    updated_at = <Date 2019-03-26.00:09:01.223>
    user = 'https://github.com/gvanrossum'

    bugs.python.org fields:

    activity = <Date 2019-03-26.00:09:01.223>
    actor = 'xtreak'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-03-26.00:05:56.013>
    closer = 'gvanrossum'
    components = ['Interpreter Core', 'asyncio']
    creation = <Date 2019-03-25.23:49:29.315>
    creator = 'gvanrossum'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36428
    keywords = []
    message_count = 4.0
    messages = ['338840', '338841', '338842', '338843']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'asvetlov', 'yselivanov', 'xtreak']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '34616'
    type = None
    url = 'https://bugs.python.org/issue36428'
    versions = ['Python 3.8']

    Activity

    1. gvanrossum commented on Mar 25, 2019

      @gvanrossum
      MemberAuthor

      I just found out about IPython's autoawait feature:
      https://ipython.readthedocs.io/en/stable/interactive/autoawait.html

      I wonder if we should at least help them do this right in Python 3.8 by having a flag to compile() that allows await in the toplevel syntax? It looks like a relatively small change would suffice to make compiler_visit_expr1() in Python/compile.c accept (and generate correct code for) Await_kind outside async functions, if some flag is set.

    2. 1st1 commented on Mar 25, 2019

      @1st1
      Member

      Absolutely. I think there's another open issue for this and I even have a dev branch somewhere with this idea half implemented. Definitely something to have in 3.8.

    3. tirkarthi commented on Mar 26, 2019

      @tirkarthi
      Member

      I think this is same as bpo-34616 . The issue talks about the workarounds IPython has to use for the feature and links to the PR where it was implemented ipython/ipython#11265 . I never knew about this feature and this will be very helpful to have especially it reduces boilerplate in having async functions for await calls though asyncio.run improved setting up loop part. Helps in playing around with API in repl during learning with top level await expressions allowed in repl.

    4. gvanrossum commented on Mar 26, 2019

      @gvanrossum
      MemberAuthor

      Oh, you're right. Thanks! Closing in favor of bpo-34616.

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions