Live data from Hacker News

Python 3.5.0

python.org

61–70 of 165 posts

Re: Python 3.5.0

#62
post #60
post #58

Earlier quoted context omitted.

Is Py3 ready for prime time? Do all the right libraries have support now?

Yes -- I write ~95% of my python code in 3, and scrapy is the only library I commonly use that doesn't support it. Here's a listing of package compatibility: http://py3readiness.org/ .

and the other one: https://python3wos.appspot.com/

Re: Python 3.5.0

#63
post #58

Python 3 keeps getting better and better. I've been writing more code in Python 3 than 2 for about three years now, and I absolutely love it. When I have to write code in 2.7 now, it feels like shifting from fifth gear down to second.

Is Py3 ready for prime time? Do all the right libraries have support now?

It's been ready for prime time for the past 3 years.

Re: Python 3.5.0

#64
post #57

I'd love to use Python 3. Alas, I work in the defense industry and am working on a new development project in Python 2.6. Why? Because that's the version that's already installed on the client's systems, and getting anything new installed is such a nightmare of Vogon-esque policies and procedures that I've learned not to even ask. I'm constantly having to hack around bugs in ancient versions of libraries that have be…

If you're already working around bugs you could create your own venv with a later version. Easier to ask forgiveness than permission.

Re: Python 3.5.0

#65
post #49

Question - is there any web/api framework that leverages asyncio ? This implicitly also means first class DB/ORM support. Flask, sqlalchemy ,etc seem to be using gevent and py 2.7.

I'm not sure, but perhaps aiohttp[1] fits the bill? Not sure if there's a "full" framework that does everything, but take a look at the simple benchmark code: https://github.com/klen/py-frameworks-bench/blob/develop/fra... (from: http://klen.github.io/py-frameworks-bench/ ) [1] http://aiohttp.readthedocs.org/en/stable/

in this case, how are most of you guys writing code with asyncio ? or is there any code being written at all.

Right now, it seems to me that Python 3.5 is not ready for adoption since it is not usable with any framework at all. I mean, I really want to use asyncio, but 99% of python mindshare is around SqlAlchemy, Bottle, Flask, Django and Cherrypy. and I cant use it with any of them.

aiohttp looks cool, but I would much rather use one of the above for now. Anybody know why are none of these framework maintainers leveraging this stuff ?

Re: Python 3.5.0

#66
post #49

Question - is there any web/api framework that leverages asyncio ? This implicitly also means first class DB/ORM support. Flask, sqlalchemy ,etc seem to be using gevent and py 2.7.

I'm not sure, but perhaps aiohttp[1] fits the bill? Not sure if there's a "full" framework that does everything, but take a look at the simple benchmark code: https://github.com/klen/py-frameworks-bench/blob/develop/fra... (from: http://klen.github.io/py-frameworks-bench/ ) [1] http://aiohttp.readthedocs.org/en/stable/

[deleted]

Re: Python 3.5.0

#67
post #3
post #2

By far the most exciting news here, to me, is PEP 484 typing module. Typing support would eliminate one of pythons biggest weaknesses. Furthermore, having it optional means it can remain as easy play and prototype with while becoming "more professional." The other features are all well rounded, with co-routines having quite some potential, though I'd have to play around with them first to assess. Now if everything wo…

I like the thought of coroutines, but it's definitely been especially slow for the ecosystem to adapt to asyncio so far. (And for good reason. It has new syntax that doesn't play well with non-asyncio). Adding even more syntax for the same things may slow down adoption more? Admittedly, it's much better syntax. The optional typing is a tricky subject. I'll have to wait until there are tools actually using it to see.…

FWIW Tornado already supports the new syntax: http://tornado.readthedocs.org/en/latest/guide/coroutines.ht...

Re: Python 3.5.0

#68
post #54

Question - is there any web/api framework that leverages asyncio ? This implicitly also means first class DB/ORM support. Flask, sqlalchemy ,etc seem to be using gevent and py 2.7.

Yes, there is. https://github.com/KeepSafe/aiohttp It's hard to write an asynchronous ORM though. Your options are either to use some existing synchronous ORM (like SQLAlchemy) in a thread pool (`loop.run_in_executor`) or use more low-level db driver: https://github.com/aio-libs/aiopg#example-of-sqlalchemy-opti...

[deleted]

Re: Python 3.5.0

#69
post #2

By far the most exciting news here, to me, is PEP 484 typing module. Typing support would eliminate one of pythons biggest weaknesses. Furthermore, having it optional means it can remain as easy play and prototype with while becoming "more professional." The other features are all well rounded, with co-routines having quite some potential, though I'd have to play around with them first to assess. Now if everything wo…

Yep - can't wait until Python3 is the norm.

Feels like such a step back when I have to use a Python 2.x codebase - so many little annoyances.

Re: Python 3.5.0

#70
post #54

Question - is there any web/api framework that leverages asyncio ? This implicitly also means first class DB/ORM support. Flask, sqlalchemy ,etc seem to be using gevent and py 2.7.

Yes, there is. https://github.com/KeepSafe/aiohttp It's hard to write an asynchronous ORM though. Your options are either to use some existing synchronous ORM (like SQLAlchemy) in a thread pool (`loop.run_in_executor`) or use more low-level db driver: https://github.com/aio-libs/aiopg#example-of-sqlalchemy-opti...

psycogreen is one such attempt with gevent - it works pretty well actually. that actually illustrates the confusion I'm having - gevent+py2.7 is actually working with all the major frameworks and giving all these performance benefits.

In fact if you look closely at the benchmark code (https://github.com/klen/py-frameworks-bench/blob/develop/fra...), the comparison is not against flask+gevent+psycogreen which may change the numbers.

https://pypi.python.org/pypi/psycogreen/1.0

Post reply on HN