GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — inspect module does not implement introspection API for asynchronous generators · Issue #79940 · python/cpython

inspect module does not implement introspection API for asynchronous generators #79940

New issue
Copy link
New issue
Copy link
Closed
Closed
inspect module does not implement introspection API for asynchronous generators#79940
Copy link
Labels
3.12only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-featureA feature request or enhancementA feature request or enhancement

Description

tkren
mannequin
opened on Jan 17, 2019
Issue body actions
BPO 35759
Nosy @ncoghlan, @1st1, @tirkarthi, @tkren
PRs
  • gh-79940: add introspection API for asynchronous generators #11590
  • gh-79940: add introspection API for asynchronous generators #11590
  • Files
  • 0001-inspect-add-introspection-API-for-asynchronous-gener.patch: Initial patch for getasyncgenstate and getasyncgenlocals
  • 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 = None
    created_at = <Date 2019-01-17.12:34:49.495>
    labels = ['3.8', 'type-feature', 'library']
    title = 'inspect module does not implement introspection API for asynchronous generators'
    updated_at = <Date 2019-01-17.14:15:35.489>
    user = 'https://github.com/tkren'

    bugs.python.org fields:

    activity = <Date 2019-01-17.14:15:35.489>
    actor = 'xtreak'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2019-01-17.12:34:49.495>
    creator = 'tkren'
    dependencies = []
    files = ['48066']
    hgrepos = []
    issue_num = 35759
    keywords = ['patch']
    message_count = 2.0
    messages = ['333861', '333870']
    nosy_count = 4.0
    nosy_names = ['ncoghlan', 'yselivanov', 'xtreak', 'tkren']
    pr_nums = ['11590', '11590']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35759'
    versions = ['Python 3.8']

    Linked PRs

    • gh-79940: skip TestGetAsyncGenState on wasm as it requires working sockets #102605

    Activity

    1. tkren commented on Jan 17, 2019

      @tkren
      tkrenmannequin
      on Jan 17, 2019
      MannequinAuthor
      More actions

      The inspect module does not contain functions for determining the current state of asynchronous generators. That is, there is no introspection API for asynchronous generators that match the API for generators and coroutines: https://docs.python.org/3.8/library/inspect.html#current-state-of-generators-and-coroutines.

      I propose to add inspect.getasyncgenstate and inspect.getasyncgenlocals (following inspect.isasyncgenfunction and inspect.isasyncgen).

      % ./python
      Python 3.8.0a0 (heads/fix-issue-getasyncgenstate:a24deae1e2, Jan 17 2019, 11:44:45) 
      [GCC 6.3.0 20170516] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import inspect
      >>> async def agen():
      ...     x = 1
      ...     yield x
      ...     x += 1
      ...     yield x
      ... 
      >>> ag = agen()
      >>> inspect.getasyncgenstate(ag)
      'AGEN_CREATED'
      >>> inspect.getasyncgenlocals(ag)
      {}
      >>> ag.__anext__().__next__()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      StopIteration: 1
      >>> inspect.getasyncgenstate(ag)
      'AGEN_SUSPENDED'
      >>> inspect.getasyncgenlocals(ag)
      {'x': 1}
      >>> ag.__anext__().__next__()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      StopIteration: 2
      >>> inspect.getasyncgenstate(ag)
      'AGEN_SUSPENDED'
      >>> inspect.getasyncgenlocals(ag)
      {'x': 2}
      >>> ag.aclose().send(None)
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      StopIteration
      >>> inspect.getasyncgenstate(ag)
      'AGEN_CLOSED'
      >>> inspect.getasyncgenlocals(ag)
      {}
    2. tkren
      added
      3.8 (EOL)end of lifeend of life
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancementA feature request or enhancement
      on Jan 17, 2019
    3. tirkarthi commented on Jan 17, 2019

      @tirkarthi
      tirkarthi
      on Jan 17, 2019
      Member
      More actions

      see also msg300475

    4. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    5. kumaraditya303
      added
      3.12only security fixesonly security fixes
      and removed
      3.8 (EOL)end of lifeend of life
      on Mar 5, 2023
    6. kumaraditya303
      self-assigned this
      on Mar 5, 2023
    7. kumaraditya303
      added
      topic-asyncio
      on Mar 5, 2023
    8. kumaraditya303
      removed their assignment
      on Mar 5, 2023
    9. ezio-melotti
      added this to asyncioon Mar 5, 2023
    10. github-project-automation
      moved this to Todo in asyncioon Mar 5, 2023
    11. kumaraditya303 commented on Mar 5, 2023

      @kumaraditya303
      kumaraditya303
      on Mar 5, 2023
      Contributor
      More actions

      I needed this today and was surprised that it wasn't implemented. I'll review the PR.

      Reacted by Thomas Krennwallner
    12. kumaraditya303
      added a commit that references this issue on Mar 11, 2023

      gh-79940: add introspection API for asynchronous generators to `inspe…

      ced13c9
    13. kumaraditya303
      closed this as completedon Mar 11, 2023
    14. github-project-automation
      moved this from Todo to Done in asyncioon Mar 11, 2023
    15. miss-islington
      added a commit that references this issue on Mar 11, 2023

      gh-79940: skip `TestGetAsyncGenState` on wasm as it requires working …

      534660f
    16. iritkatriel
      added 2 commits that reference this issue on Mar 12, 2023

      pythongh-79940: add introspection API for asynchronous generators to …

      f9250e4

      pythongh-79940: skip `TestGetAsyncGenState` on wasm as it requires wo…

      45cc601
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.12only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-featureA feature request or enhancementA feature request or enhancement

      Projects

      • asyncio
        Status
        Done
        Show more project fields

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.