Hacker News new | ask | show | jobs
by masklinn 451 days ago
There’s absolutely no need for async http here. The script does one http request at the top of main. And a trivial one too (just a simple GET).

    response = urlopen(url)
    return json.load(response)
is what they’re saving themselves from.
1 comments

In that case, sure, but if you have an entire async framework you don't want that blocking call.

For as much as Python is embracing async / coroutines, I'm surprised that their http functions do not support it yet.

> In that case, sure, but if you have an entire async framework you don't want that blocking call.

What “entire async framework”, do you mean asyncio or some other third party library? In the former case, are you using it just to feel cool like TFA?

> For as much as Python is embracing async / coroutines, I'm surprised that their http functions do not support it yet.

asyncio doesn’t even support async file io.

> What “entire async framework”, do you mean asyncio or some other third party library? In the former case, are you using it just to feel cool like TFA?

I was thinking more along the lines of a project like Home Assistant. For my personal stuff I have been using AnyIO.

> asyncio doesn’t even support async file io.

many operating systems do not support async file io to begin with.