|
|
Log in / Subscribe / Register

A Welcome Syntax

A Welcome Syntax

Posted Apr 24, 2025 11:28 UTC (Thu) by farnz (subscriber, #17727)
In reply to: A Welcome Syntax by mb
Parent article: Template strings accepted for Python 3.14

Ideally, I would get a syntax error if I wrote await asyncio.sleep(5), because the mental model my Python-using colleagues have is that keyword expression means "return the value of expression to the caller of this function somehow", whereas keyword(expression) means "have keyword call expression and give me back a value".

And because they don't want to return from this function (they want to wait for expression to evaluate, which involves hardware accesses), they try to put the minimum number of awaits in that seems to work for them, scoping them as broadly as possible and dragging other people in when they can't guess their way to working code.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds