Live data from Hacker News

Python 3.5.0

python.org

81–90 of 165 posts

Re: Python 3.5.0

#81

And yet, Python 2 usage is still strong while Python 3 adoption has actually slowed down , and at this rate, it will probably stop being used completely while Python 2 continues to live on: https://www.reddit.com/r/programming/comments/3k9yif/larry_w...

What's your point?

You do have a point, right? Coming in to a thread about a python release and trying to stir up controversy?

Or are you just doing it for kicks?

Re: Python 3.5.0

#82

And yet, Python 2 usage is still strong while Python 3 adoption has actually slowed down , and at this rate, it will probably stop being used completely while Python 2 continues to live on: https://www.reddit.com/r/programming/comments/3k9yif/larry_w...

What's your point? You do have a point, right? Coming in to a thread about a python release and trying to stir up controversy? Or are you just doing it for kicks?

His point seems obvious to me: he thinks Python 3 is not worth migrating to, because Python 2 will always have more users. But it disregards that Python 3 may be more comfortable. And it assumes that the Python 3 user base will shrink in the future.

Re: Python 3.5.0

#84
post #22
post #16

PEP 0448 in addition to already implemented PEP 3132 make it very tempting to switch. If PEP 0448 had unpacking in comprehensions I'd switch. (Doesn't seem be a follow-up PEP just for that functionality yet.) https://www.python.org/dev/peps/pep-0448/ https://www.python.org/dev/peps/pep-3132/ I'd be really nice to use this. >>> [*range(i) for i in range(5)] Instead of this monstrosity right now. >>> [x for y in (range…

Other options for your first case are: >>> sum((range(i) for i in range(5)), []) [0, 0, 1, 0, 1, 2, 0, 1, 2, 3] and >>> import itertools >>> list(itertools.chain.from_iterable(range(i) for i in range(5))) [0, 0, 1, 0, 1, 2, 0, 1, 2, 3] "filter keeping the type". That was only true for some types. Python 2.7's filter does not maintain the set type: >>> filter(lambda x: x in 'ABC', {'A','B','C','D','E','F','A'}) ['A',…

> sum((range(i) for i in range(5)), [])

This won't work in Python 3 since `range` is a new type (and it's O(n²) anyway, so not missed).

The second option is idiomatic IMHO.

Re: Python 3.5.0

#85
post #22
post #16

PEP 0448 in addition to already implemented PEP 3132 make it very tempting to switch. If PEP 0448 had unpacking in comprehensions I'd switch. (Doesn't seem be a follow-up PEP just for that functionality yet.) https://www.python.org/dev/peps/pep-0448/ https://www.python.org/dev/peps/pep-3132/ I'd be really nice to use this. >>> [*range(i) for i in range(5)] Instead of this monstrosity right now. >>> [x for y in (range…

Other options for your first case are: >>> sum((range(i) for i in range(5)), []) [0, 0, 1, 0, 1, 2, 0, 1, 2, 3] and >>> import itertools >>> list(itertools.chain.from_iterable(range(i) for i in range(5))) [0, 0, 1, 0, 1, 2, 0, 1, 2, 3] "filter keeping the type". That was only true for some types. Python 2.7's filter does not maintain the set type: >>> filter(lambda x: x in 'ABC', {'A','B','C','D','E','F','A'}) ['A',…

[deleted]

Re: Python 3.5.0

#86
post #49

Earlier quoted context omitted.

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…

You can definitely use asyncio with CherryPy: http://ws4py.readthedocs.org/en/latest/sources/servertutoria...

Re: Python 3.5.0

#87
post #71

Earlier quoted context omitted.

It has the ability to statically check the type system , that's amazing. Moreover async/await with async resource management (which C# doesn't have yet) gives it a real edge for server development.

What is async resource management? can you link to docs for the features you mean? I'm having trouble googling this one, maybe different keywords are used?

I think inglor refers to the new 'async with' statement: https://docs.python.org/3/reference/compound_stmts.html#asyn...

Using it you can safely cleanup/commit transaction/release lock/etc when exiting a block of statements (even if an exception was raised). Plain 'with' statement cannot call asynchronous code in '__exit__' methods, 'async with' can do that (in '__aexit__').

Re: Python 3.5.0

#88
post #41

I've recently joined a Python project, my first time working with the language. We're currently using Python 2.7. How do experienced Pythonistas decide if/when to upgrade to 3.x? I figured it was a no brainer given that it has been 7 years with a number of big releases, but Flask's warning on this topic put me off: http://flask.pocoo.org/docs/0.10/python3/

I like the "use Python 3 by default, and only use Python 2 if you have mandatory dependencies that aren't 3.x compatible" rule.

Re: Python 3.5.0

#89

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.

> When I have to write code in 2.7 now, it feels like shifting from fifth gear down to second.

You mean, second gear up to fifth?

I tried writing some Python 3 code and the lack of parameter tuple unpacking by itself stunned me and drove me crazy, never mind other stuff. Python 3 seems very user-unfriendly compared to Python 2. Won't touch it with a ten foot pole unless my life depends on it.

Re: Python 3.5.0

#90
post #16

PEP 0448 in addition to already implemented PEP 3132 make it very tempting to switch. If PEP 0448 had unpacking in comprehensions I'd switch. (Doesn't seem be a follow-up PEP just for that functionality yet.) https://www.python.org/dev/peps/pep-0448/ https://www.python.org/dev/peps/pep-3132/ I'd be really nice to use this. >>> [*range(i) for i in range(5)] Instead of this monstrosity right now. >>> [x for y in (range…

Hi, I implemented most of PEP448. We actually implemented [*range(i) for i in range(5)] and {**d for d in ds} but it was removed ultimately because people in dev-python found it confusing. If you're interested in seeing that construction in Python, I suggest waiting until 3.5 gains some traction and then making a suggestion in python-ideas.

I have a few follow-up ideas/discussions to raise on the list, and this'll be one of them. As you say, I'd like to wait for things to settle and people to get an idea of the new functionality first.

FWIW, I'm the PEP writer. It's not my invention, I just wrote it up. It still makes me glad when people mention the PEP, though :).

Post reply on HN