Live data from Hacker News

Python 3.5.0

python.org

31–40 of 165 posts

Re: Python 3.5.0

#31
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.

Re: Python 3.5.0

#32
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…

This: >>> [x for y in (range(i) for i in range(5)) for x in y] can be simplified into: [y for x in range(5) for y in range(x)]

[deleted]

Re: Python 3.5.0

#34
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.

Re: Python 3.5.0

#36
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.

Re: Python 3.5.0

#37
post #15
post #10

Earlier quoted context omitted.

Doubt it. The @ symbol isn't implemented by default. It's just available as a syntactic element primarily for NumPy to use, though other libraries are free to use it as well.

I want to see it used for an XML library, since I think node@"name" is a more succinct, and domain-appropriate equivalent for node.attrib.get("name").

I have kind of mixed feelings. The biggest argument against that PEP was that people would use it for things that are very unlike matrix multiplication, which can be confusing. I can kind of see the point there, but on the other hand the @ symbol really is natural for things like what you suggest.

Re: Python 3.5.0

#38
Very pleased to see PEP 465. In many ways I think python is one of the most exciting languages in terms of where it is going and what it is trying to do.

Re: Python 3.5.0

#39
post #6
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…

Heh, for me it's the matrix multiply operator. Such a minor addition will make for a pretty big improvement to my day-to-day coding experience.

[deleted]

Re: Python 3.5.0

#40
post #8
post #6

Earlier quoted context omitted.

Heh, for me it's the matrix multiply operator. Such a minor addition will make for a pretty big improvement to my day-to-day coding experience.

Agreed but does this apply in Numpy as well? Will Python matrix multiplications just work on lists of lists in which case they're much slower? Sorry just asking from a 2.7 holdout here as this might cause me to move.

If you grab the latest code in master from https://github.com/numpy/numpy you'll get support for @ in numpy. It's great!
Post reply on HN