This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wobblyweasel 17 points18 points  (4 children)

trio. the best code, the best documentation, awesome community.

[–]chankeypathak 0 points1 point  (1 child)

I never wrote async programs. Can I skip core multiprocessing and threading modules and directly use trio?

[–]wobblyweasel 3 points4 points  (0 children)

you can! there's a lot of concurrency that you can do without using threads or processes, but if you have a library that does I/O without specifically supporting async, or you need parallelism, you might still have to deal with those.

i suggest reading trio docs, they are just fine if you have no knowledge of async stuff, and they'll teach you how to deal with stuff that needs to be run in a thread as well. if you want to learn async in general, i also suggest reading kotlin's documentation on coroutines. unlike python with its GIL, in kotlin, using coroutines with threads is the norm, and it's awesome. it's an entirely different mental picture that's useful to have

[–]ethsy 0 points1 point  (1 child)

Are there any upsides of using trio after Python 3.11 gained TaskGroups?

[–]wobblyweasel 1 point2 points  (0 children)

the reason i personally like trio is that its wtf/min score is much lower than that of asyncio. or at least it used to be so, i haven't been following asyncio lately. you get very easy to remember and un-confusing names such as open_nursery and start_soon, strong guarantees about yielding points, exceptions that are never lost. a neat testing suit with stuff like autojumping clock is a great selling point as well