4
endor
5y

Started learning python async with curio and trio just two days ago, and I must say I'm really having a blast.
I have a few pending ideas to combine it with websockets (also first time I'm learning how to use them).
Haven't had this much fun with python in a while!

Also, sidequestion: how can return a value from an async function with curio or trio? I can't find a proper answer or example about that, other than some hints about memory channels in trio

Comments
  • 1
    No idea, just questions☺️

    How does curio stack up to asyncio?
    https://docs.python.org/3/library/...
  • 1
    @SortOfTested honestly I have never used asyncio myself, but the whole reason I chose to go with curio (and the similarly inspired trio) was this article: https://vorpus.org/blog/...

    It's quite a long read, but really well explained and detailed. Long story short, curio is just designed completely differently from the ground up, and (generally speaking) seems more intuitive and less error-prone because it just forces you to do things the right way from the start, instead of letting you mash everything together and shooting yourself in the foot.

    trio seems to take this even further: it's quite opinionated, but going through the docs and issues it seems they've really mulled things over before making the design choices they've made.

    Mind you, I only have a few days worth of experience with all this, so my perception could be way off. But judging by how quickly I'm picking this up, I say they must be doing something right
  • 0
    Just found out how to get the return value of an async function with curio:
    foo = await curio.spawn(function, *args)
    await foo.join()
    bar = foo.result
Add Comment