News for hackers. Stuff that matters.
Re:Django 3 by singularity2001 on Monday December 02, 2019 @10:00AM (#21682866)
please tell me that python did not adopt the javascript async hell. async should be an optional keyword on the CALLER side, not an invisible trait of the function. go figure()
Re:Django 3 by m_ke on Monday December 02, 2019 @10:11AM (#21683000)
It didn't, async await is just syntactic sugar on top of coroutines/futures. You can define an sync function and get a coroutine back if you call it without await.

It's still kind of a mess though because you have two universes that are not really compatible, forcing you to rewrite everything that touches IO. For django that probably means a rewrite of the ORM, caching and middlewares.

Re:Django 3 by hajile on Monday December 02, 2019 @11:36AM (#21683983)
JS async/await is also just syntactic sugar on top of Promises (which are basically just futures with the ability to write as well).
Re:Django 3 by jakear on Monday December 02, 2019 @12:01PM (#21684252)
In Javascript, async is an optional parameter on the caller side. (Well, 'await' is, but I figure that's what you mean). It can be used with any function call, not just those that are marked async. Though it only make sense to use it with Promise-returning functions.

Alternatively, you can also use it with a plain Promise, which makes for a nice mutex. I've also used this for imitating async constructors, which is not currently possible.