Python Operators(thetaranights.com)
thetaranights.com
Python Operators
https://www.thetaranights.com/python-operators/
12 comments
This is especially true for the case of mutables. I agree it should've been mentioned on the blog. Do you mind if I add this thread to the comments section of the blog.
After you're mastered all the available operators the real fun begins when you start writing your own operator methods on classes http://thepythonguru.com/python-operator-overloading/
The ability to override operators is one of the things I miss most from Python when I'm forced to write javascript.
The ability to override operators is one of the things I miss most from Python when I'm forced to write javascript.
That's a great post. Thanks for the link. These methods do enhance classes to the best. I also made a short blog about magic methods. Could be relevant to someone reading the threads https://www.thetaranights.com/magic-methods-in-python/
There could also be mention of the "right" variants e.g. __rmul__ vs. __mul__. https://stackoverflow.com/questions/5181320/under-what-circu... gives a rough sketch of what they're about.
This is indeed a very helpful read. Thanks for the link.
The := is missing! No wonder Guido would leave its BDFL position!
Isn't that for 3.8 version. I have also made a different blog around PEP 572 some time ago. I will leave the link here so it is helpful for anyone wondering about :=
https://www.thetaranights.com/python-assignment-expression-p...
https://www.thetaranights.com/python-assignment-expression-p...
By comparison,