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.
Python 3.5.0
11–20 of 165 posts
Re: Python 3.5.0
#12Earlier 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.
Re: Python 3.5.0
#13Earlier 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.
The matrix multiplication PEP is actually titled "A dedicated infix operator for matrix multiplication", and that's (broadly) the only thing that it provides. Here's the arguments for why the operator should exist: https://www.python.org/dev/peps/pep-0465/#why-should-matrix-...
numpy and other libraries might/has/will implement the matrix multiplication infix operator for their array and matrix data types.
Re: Python 3.5.0
#14Re: Python 3.5.0
#15Earlier quoted context omitted.
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.
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.
Re: Python 3.5.0
#16https://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(i) for i in range(5)) for x in y]
Python 2.7 has some minor features that 3 dropped unfortunately, which still makes me hesitate.Such as filter keeping the type. In 3 it returns an iterator.
>>> filter(lambda x: x in 'ABC', 'ABCDEFA')
'ABCA'
Or this mostly cosmetic feature. >>> filter(lambda x: x[0] > x[1], ((1, 2), (4, 3)))
>>> filter(lambda (x, y): x > y, ((1, 2), (4, 3))) # equivalent, error in 3
Also dropped. (It's slower than using the dedicated base64 module though.) >>>'Python'.encode('base64')
'UHl0aG9u\n'
Also, I like print.Re: Python 3.5.0
#17Re: Python 3.5.0
#18Earlier 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.
http://legacy.python.org/dev/peps/pep-0465/#id24
Implementing __matmul__, __rmatmul__ and __imatmul__ will allow you to apply this operator to any given class. In that light, you could subclass the numpy matrix class yourself and simply apply these.
As for whether these will be applied to Python lists, my speculation is: I doubt it. Its possibly the most commonly used data structure, and I doubt they would add the overhead of another set of methods on each instance.
Re: Python 3.5.0
#19PEP 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…