I think this is a subtler point than one might think on first read, which is muddled due to the poorly chosen examples.
Here's a better illustration:
import asyncio
async def child():
print("child start")
await asyncio.sleep(0)
print("child end")
async def parent():
print("parent before")
await child() # <-- awaiting a coroutine (not a task)
print("parent after")
async def other():
for _ in range(5):
print("other")
await asyncio.sleep(0)
async def main():
other_task = asyncio.create_task(other())
parent_task = asyncio.create_task(parent())
await asyncio.gather(other_task, parent_task)
asyncio.run(main())
It prints: other
parent before
child start
other
child end
parent after
other
other
other
So the author's point is that "other" can never appear in-between "parent before" and "child start".Edit: clarification
But isn't it true for JavaScript too? So I don't really get the author's point... am I missing something or the author('s LLM?) forced a moot comparison to JavaScript?
Edit: after reading the examples twice I am 99.9% sure it's slop and flagged it.
Edit2: another article from the same author: https://mergify.com/blog/why-warning-has-no-place-in-modern-...
> This isn’t just text — it’s structured, filterable, and actionable.
My conclusion is that I should ask LLM to write a browser userscript to automatically flag and hide links from this domain for me.
You're right, the equivalent JS script produces the same sequence of outputs.
It turns out there is a way to emulate Python's asyncio.create_task().
Python:
JavaScript: