3 ms·
> Take for example the plus sign. Everytime we encounter it, we will most likely be dealing with some kind of abelian group. So just from seing the sign, we can
by enriquto 6y ago
> Take for example the plus sign. Everytime we encounter it, we will most likely be dealing with some kind of abelian group. So just from seing the sign, we can already tell a lot about the context.
This! This is exactly my biggest pet peeve in Python. That the plus operator is used, in the base language, for such a notoriously non-abelian operation as string concatenation. As Carlin would say, this is not a pet peeve, this is a major psychiatric hatred of mine. In the (fortunately few) occasions that I have to do string processing in Python, I go to great lengths to avoid any usage of the concatenation operator. I cannot bear myself to use it.
- augustt 6y agoMaybe you've used it already, but you'll like how Julia does it. String concatenation is *, repetition is ^, and the identity element is one(String) = "".
- BiteCode_dev 6y agoGood because it's rarely a good idea to use it nowaday. Python has much better alternatives with join, __format__ and f-strings.