Matthias Urlichs <> added the comment:

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

async def gen():
    yield 1234

async def foo():
    import pdb;pdb.set_trace()
    async with gen() as x:
        assert x == 1234
# 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 <>
Python-bugs-list mailing list

Reply via email to