Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The standard library does not give you a possibility to do async HTTP requests, that's what httpx does. As Python still heavily relies on async this is really a bummer.


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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: