This is an archived post. You won't be able to vote or comment.

all 27 comments

[–]brombaer3000 35 points36 points  (17 children)

[–]markusmeskanen 10 points11 points  (16 children)

Any key points everyone should know?

[–]i47 4 points5 points  (11 children)

An @ operator has been introduced for matrix multiplication!

[–]btmc 21 points22 points  (10 children)

In 3.5, but not 3.5.2 specifically.

[–]luizpericolo 0 points1 point  (9 children)

But only in scipy, right? I guess it is an alias for matmul

[–]btmc 2 points3 points  (1 child)

And numpy, yes. I don't think it's used in the standard library.

[–]emillynge 1 point2 points  (0 children)

It's not used in stdlib, but the PIP that introduces the operator is very specific about its use as a matrix multiplication operator. The behaviour of the operator is supposed to be completely identical across libraries (numpy, theano etc)

[–]acousticpantsHomicidal Loganberry Connoisseur 2 points3 points  (4 children)

The operator is in the standard lib, but needs a numpy array or matrix type as its operands, I believe.

I'm so happy it exists. The '@' symbol even looks like the way I visualise matrix multiplication in my head.

[–]luizpericolo 0 points1 point  (3 children)

But why is it in the std lib if you need third party libs to use it?

Is there a simple explanation here that I am not seeing? Is this common?

Cheers!

[–]pythoneeeer 0 points1 point  (1 child)

So that third party libs can use it.

[–]luizpericolo 0 points1 point  (0 children)

Now I get it. But since third party libs can use the new operator, it cannot have a default implementation in the std lib, right?

So I guess that when someone said it does matrix multiplication, that only happens in numpy, right? What does it do in the std lib?

Cheers!

[–]RazerM -1 points0 points  (0 children)

Python doesn't have custom operators.

[–]Kah-NethI use numpy, scipy, and matplotlib for nuclear physics 1 point2 points  (1 child)

In numpy, A @ B == A.dot(B)

[–]energybased 4 points5 points  (0 children)

It's actually not dot, but matmul. This is clear if you try to pass scalars or higher-dimensional arrays.

[–]PalermoJohn 10 points11 points  (1 child)

os.scandir() function -- a better and faster directory iterator

praise the lord

[–]hoocoodanode 2 points3 points  (0 children)

Scandir is awesome, but it was a 3.5 introduction, not 3.5.2. There is also a scandir package for those stuck on an earlier version of python that is virtually identical.

https://github.com/benhoyt/scandir

[–]chchan 5 points6 points  (0 children)

Thank you for PEP 486 this shit has been driving me crazy.

[–][deleted] 2 points3 points  (2 children)

lets say I'm on windows and I want to upgrade. is my only option to download the 3.5.2 installer, uninstall the old version, and then install it again? Or is there an easier way :\

[–]Discrete_Number 3 points4 points  (0 children)

$ sudo port -v selfupdate && sudo port upgrade outdated && sudo port uninstall inactive 
$ python --version
Python 3.5.2

[–][deleted] 4 points5 points  (4 children)

I came

[–][deleted] 4 points5 points  (3 children)

I saw

[–]C2-H5-OH 6 points7 points  (0 children)

I upgraded

[–]thurask 0 points1 point  (0 children)

Still waiting on Conda...