8 ms·
Show HN: Asynchronous HTTP/2 client for Python 2.7
- benatkin 9y agoIts name made me think of THC. I'll ask the obvious question: why not Python 3?
- vsmhn 9y agoWell, Python 3 already has a similar library that deals with this stuff, such as https://github.com/decentfox/aioh2 https://github.com/decentfox/aioh2. Also, this is mostly intended for Tornado backends, offering compatibility with Tornado's request / response objects.
- benatkin 9y agoI see. May I suggest linking to that in the README? And if you aren't part of the Python 2 forever camp, suggest how one might migrate from using your library to using python 3 with the other library in the future? And if the APIs aren't similar it might be a good idea to make them similar.
- vsmhn 9y agoI understand your point, and I'll try to update the README with that information. However, this client tries to follow Tornado's ways, whereas aioh2 works on Python's asyncio. It's still WIP, so feedback like yours helps a lot, thanks!
- peterkelly 9y agoAre people really still so closely wedded to Python 2 that they find it easier to reimplement all the features they need from Python 3 in the former, instead of switching to the latter?
- coldtea 9y agoYes.
- siimtalvik 9y agoyes. I had a coworker who was against moving to python3(and kept on writing python2 code for a while) because you need to use brackets with python3 print statement.
- always_good 9y agoJust think of any large code base and it should be obvious. What's simpler, rewriting a massive project, or maintaining a library? For example, OP did the latter himself.
- yoz-y 9y agoAny specific reason to develop this for Python 2 rather than Python 3?
- melling 9y agoThe end of life is in 2020 but it doesn’t say when. Is this still the latest? http://legacy.python.org/dev/peps/pep-0373/ http://legacy.python.org/dev/peps/pep-0373/
- sanxiyn 9y agoIt's January 1st, 2020. https://mail.python.org/pipermail/python-dev/2018-March/152348.html https://mail.python.org/pipermail/python-dev/2018-March/1523...
- meddlepal 9y agoThere's still a lot of existing and new Python 2 code being written. Idealistically we would all be on Python 3, but software is a messy land.
- goatlover 9y agoIt's been ten years, so it's gone beyond "idealistically".
- CJefferson 9y agoStill not distributed by default on Mac or Ubuntu long term release, unlike 2.
- rspeer 9y agoThe current Ubuntu long-term support release is Xenial, which comes with only Python 3 installed. If you're talking about Trusty, its support is ending fairly soon. On Xenial, you have to separately install an optional package for Python 2. When you try to run /usr/bin/python on a fresh Xenial install, it'll tell you that you need to install a package such as python-minimal==2.7.11, whereas /usr/bin/python3 is already there.
- vsmhn 9y agoWhy Python 2 and not Python 3? Short answer is: because Python 3 already benefits from a better, more complete client: aioh2 (https://github.com/decentfox/aioh2 https://github.com/decentfox/aioh2) that works with Python's asyncio. th2c is mostly intended for Tornado backends, trying to keep a similar interface and compatibility with Request / Response objects. It was initially developed in order to be able to communicate with APNS from a python 2.7 environment.
- ericfrederich 9y agoHow does that compare to aiohttp? What are the benefits?
- vsmhn 9y agoI'm not sure I understand the question, are you interested in comparing tornado and aiohttp?
- omginternets 9y agoaio isn't available for py2. The benefit is that this is available for py2.
- loeg 9y agoThere is https://github.com/vstinner/trollius https://github.com/vstinner/trollius for vanilla Python2.
- vsmhn 9y agotrollius is no longer maintained
- loeg 9y agoIt's still a reasonable starting place for anyone wanting asyncio on vanilla Python2. Outside of vanilla Python2, Tauthon also has some tracking issues for the language extensions and libraries needed for a backport of asyncio to Tauthon.[0] [0]: https://github.com/naftaliharris/tauthon/issues/10 https://github.com/naftaliharris/tauthon/issues/10
- ericfrederich 9y agoQt has an event loop and async http library. I've used it from PyQt with great success.
- gigatexal 9y agoI’m of the opinion that one should only maintain python2 projects not actively develop and expand them. If your project needed http2 then it should be ported to python3. Edit: would using python3 in a container make sense where the distribution only ships legacy python?
- coldtea 9y agoWhat if a company has a large codebase that's in Python 2 and wants http2? Will those suggesting porting help them bear the costs and manhours it takes? (Google, for one, still uses 2. As does Dropbox. And both companies had Guido Van Rossum working for them at some point).
- goatlover 9y agoCompanies are going to have to port at some point.
- brudgers 9y agoGoogle has Grumpy. Because writing a compiler is easier than porting. https://github.com/google/grumpy https://github.com/google/grumpy
- enitihas 9y agoNot sure about that. Some companies may have codebases as complicated as the python codebase itself. For them it may make more sense to maintain python2 than to upgrade. Granted, there will be very few such companies.
- kbutler 9y agoUnjustifiable assertion. - they could continue to maintain python2 - they could move to a non-python platform - they could go out of business - they could hold out for Python4 (Python3 was only 8 years after Python2) ...
- kevinmgranger 9y ago