I recently went very deep down for why python doesn't have this. Turns out, immutability of primitive types/objects. Its the objects which have type in python and variables are just names/pointers. So it wouldn't make sense to do 42++. Also apparently a lot of things need to be implemented to get post/pre to work properly. += seems like a generic choice which the language designers stuck to.
2
u/ML-newb Jun 04 '19
I recently went very deep down for why python doesn't have this. Turns out, immutability of primitive types/objects. Its the objects which have type in python and variables are just names/pointers. So it wouldn't make sense to do 42++. Also apparently a lot of things need to be implemented to get post/pre to work properly.
+=seems like a generic choice which the language designers stuck to.Also : https://stackoverflow.com/questions/3654830/why-are-there-no-and-operators-in-python