[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2021-01-01 Thread David Beazley


Change by David Beazley :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2019-08-08 Thread George Zhang


George Zhang  added the comment:

Also, while the PEP first introducing asynchronous generators stated that its 
.asend() and .athrow() methods will return a "coroutine-like object", it 
doesn't allow any introspection into its state or parent async generator.

My workaround was to wrap the .asend() and other methods with another coroutine 
that just awaits and returns the result. Having a better way to check its state 
and frame will bring it closer to a coroutine.

--
nosy: +GeeVye

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2019-02-12 Thread Joshua Oreman


Joshua Oreman  added the comment:

I also ran into this. My workaround was to use gc.get_referents() on the 
async_generator_asend object, which returns a one-element list containing the 
async generator object. I don't know if this is guaranteed or just happened to 
work in the cases I was using it, but it might be good enough?

--
nosy: +Joshua Oreman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-12-15 Thread Yury Selivanov


Yury Selivanov  added the comment:

Please don't merge the PR. I'll need some time to think about this before 
giving it a green light.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-12-14 Thread Zackery Spytz


Zackery Spytz  added the comment:

I've created a PR for this issue.

--
nosy: +ZackerySpytz
versions: +Python 3.8 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-12-14 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +10403
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-09-19 Thread Keith Dart


Change by Keith Dart :


--
nosy: +kdart

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-02-10 Thread Xavier G. Domingo

Change by Xavier G. Domingo :


--
nosy: +xgdomingo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-02-10 Thread David Beazley

David Beazley  added the comment:

I've attached a file that illustrates the issue.

(Side thought: this would be nice to have in inspect or traceback)

--
Added file: https://bugs.python.org/file47434/agen.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-02-10 Thread Andrew Svetlov via Python-bugs-list

Andrew Svetlov  added the comment:

Make sense at first glaze.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-02-09 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
components: +asyncio

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-02-09 Thread Nathaniel Smith

Change by Nathaniel Smith :


--
nosy: +asvetlov, giampaolo.rodola, njs, yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-02-09 Thread Yarko Tymciurak

Change by Yarko Tymciurak :


--
nosy: +yarkot

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32810] Expose ags_gen and agt_gen in asynchronous generators

2018-02-09 Thread David Beazley

New submission from David Beazley :

Libraries such as Curio and asyncio provide a debugging facility that allows 
someone to view the call stack of generators/coroutines.  For example, the 
_task_get_stack() function in asyncio/base_tasks.py.  This works by manually 
walking up the chain of coroutines (by following cr_frame and gi_frame links as 
appropriate).   

The only problem is that it doesn't work if control flow falls into an async 
generator because an "async_generator_asend" instance is encountered and there 
is no meaningful way to proceed any further with stack inspection.

This problem could be fixed if "async_generator_asend" and 
"async_generator_athrow" instances exposed the underlying "ags_gen" and 
"agt_gen" attribute that's held inside the corresponding C structures in 
Objects/genobject.c.  

Note: I made a quick and dirty "hack" to Python to extract "ags_gen" and 
verified that having this information would allow me to get complete stack 
traces in Curio.

--
messages: 311906
nosy: dabeaz
priority: normal
severity: normal
status: open
title: Expose ags_gen and agt_gen in asynchronous generators
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com