A Welcome Syntax
A Welcome Syntax
Posted Apr 23, 2025 12:44 UTC (Wed) by farnz (subscriber, #17727)In reply to: A Welcome Syntax by kleptog
Parent article: Template strings accepted for Python 3.14
They use await because they're working with a whole pile of external libraries (since virtually all they write is glue code for hardware test harnesses) that require them to use await. And the trouble is that they don't know Python - or tcl, or bash, or VBA, or any other programming language - which means that they're coming up with ad-hoc theories of how programming works.
For example, they expect that res = func(foo) + func2(bar); res = await res will work, as will res = await func(foo) + func2(bar), as shorthand for res = await func(foo) + await func2(bar), because that fits their ad-hoc theories, and it doesn't work (for reasons that are very obvious to any programmer). I had some success getting them to write this as res = (await func(foo)) + (await func2(bar)), but that's fallen by the wayside over time as people remove the outer parentheses, and then get confused again when they come to copy-and-paste this into a new test harness.
If they were programming regularly, they'd learn that "await func" is indivisible. But they're not - they're usually working in the lab with physical hardware, writing equations and things to convince themselves that their measurements are telling them what they expect to see, and then eventually coming back to automate this. And we're not big enough to afford someone employed full time to turn their test harnesses into code based on written descriptions, so we suffer instead.
