The Incredible Growth of Python (stackoverflow.blog)

Rustom Mody rustompmody at gmail.com
Tue Sep 12 00:14:44 EDT 2017


On Monday, September 11, 2017 at 1:28:24 PM UTC+5:30, Marko Rauhamaa wrote:
> Gregory Ewing:
> 
> > Chris Angelico wrote:
> >> Async functions in
> >> JS are an alternative to callback hell; most people consider async
> >> functions in Python to be an alternative to synchronous functions.
> >
> > What do you base that on? Seems to me async is an alternative
> > to callback-based frameworks such as Twisted.
> >
> > Calling async functions an alternative to sync functions
> > doesn't make sense, because if sync functions will do what
> > you want, there's no need to use async ones.
> 
> Asyncio makes it possible to write a single-threaded program in
> multithreading style.
> 
> The multithreading style means entwining the state of a finite state
> machine in the form of the source code. While a callback-based program
> will use one or more variables (object attributes) to store the state --
> or leave it implicit -- an asyncio program marks each state with the
> "await" keyword.
> 
> The multithreading style is convenient in cases where each state is
> blocked on a single possible event. Trouble is, most state machines I
> run into (and that's my bread and butter), each state is blocked on
> several or even numerous alternative events.

Do you have some reading material suggestions for grokking the a-world?



More information about the Python-list mailing list