Comment

Comment by reichstein

So the `+` is not _overloaded_, the `+` syntax is a shorthand for calling a method named `__add__` on the value of the first operand, with the value of the second operand as an argument . That is: `e1 + e2` is syntactic sugar for `e1.__add__(e2)`, no more and no less.

It's not "operator overloading" any more than two _different_ classes having a `length` property is "length overloading".

Using the term "operator overloading" to begin with is the error here.

parent reichstein 3 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton