A Welcome Syntax
A Welcome Syntax
Posted Apr 22, 2025 19:52 UTC (Tue) by intelfx (subscriber, #130118)In reply to: A Welcome Syntax by farnz
Parent article: Template strings accepted for Python 3.14
> Once you've done that, there's less need for the async keyword (since Python is dynamically typed, so you don't need the type signature to tell you whether this thing is a function or a coroutine), so I'd also be tempted to remove the async keyword in Python; await(…) becomes syntax for "this thing takes part in coroutine scheduling at this point", and have the decision about whether a function is async or not be made based on whether or not it contains a await(…) in the body.
This is pure spooky action at a distance.
The async-ness of the function drastically changes the way it has to be used, with no room for any kind of substitution principle (i.e., yes, in a dynamically typed language, you can change the return type in some ways if the new type supports all operations the old one did, but this does not work with generators because there is zero overlap between normal types and generator types).
So no, I cannot agree that such a change could be in any way desirable.
