Matthias Urlichs <sm...@smurf.noris.de> added the comment:

"Example of a problem"? Well, just single-step into, and then back out of, an 
@asynccontextmanager-decorated function.

@asynccontextmanager
async def gen():
    yield 1234

async def foo():
    import pdb;pdb.set_trace()
    async with gen() as x:
        assert x == 1234
    print("done")

trio.run(foo)
# asyncio.get_event_loop().run_until_complete(foo())

Let's assume that you want to single step through that context manager. Now 
count how often you need to press "s" until you arrive at the print statement. 
With my patch it's 7. Without the patch there are 30 additional steps within 
the asynccontextmanager. If you need Python 3.6 compatibility and also use 
@async_generator you need to hit Return ~130 times. That's way too much.

Or: let's say you want to step across an await statement that actually goes 
through a context switch. You hit "n" and see a <Return>. With something like 
my patch, and assuming there's no other context to switch to, hitting "s" gets 
you back to the current context.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32900>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to