lingo.lol is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for linguists, philologists, and other lovers of languages.

Server stats:

69
active users

#coroutine

0 posts0 participants0 posts today

I need some obscure python help, fellow mastodonians:

I have a nested async function inside a regular function.

I need to test whether to await on it inside a decorator, but neither of `inspect` or `asyncio` helpers work, and .__code__.co_flags do not indicate it being a coroutine/awaitable/...

Right now I've added a flag to my decorator to manually control wrapped function behavior, but it's just a workaround.

Any tips? Thanks.

Can you recommend any general learning resources on coroutines?

I'm looking for tutorials, books, or other non-video sources that are largely language independent (or introduce a few primitives clearly) and, most importantly, explain how to program with couroutines and for which problems or situations they're typically used. I'm looking to learn the concepts, not features of specific languages.

I'm not interested in other control or concurrency primitives.