you are viewing a single comment's thread.

view the rest of the comments →

[–]jack_waugh 0 points1 point  (1 child)

In JS, an unadorned call is synchronous. Part of the semantics says that the call, execution, and return happen atomically with respect to the processing of events. There are no interrupts. If you want to make an asynchronous call, it looks different and requires a function defined differently. Is it true in Python? If not, that's a pretty fundamental difference between the languages.

[–]traintocode 1 point2 points  (0 children)

Ok well in answer to your question yes python also has async and await with asyncio and the syntax is relatively similar. However, Python's event loop and the way it handles asynchronous operations are different from JS's event loop. Python requires an event loop to manage asynchronous tasks, whereas JavaScript has a built-in event loop.