Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I love operator overloading, I love how Python does it (once you satisfy an interface, its operators Just Work).

Is this different from other styles of operator overloading? Why does it matter whether, when I want to overload the + sign, I need to define a function called `__add__` or `operator+`?



For me it's easier to introspect, fewer unexpected corners. Contrast this with operator overloads which you can put literally anywhere.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: