News for hackers. Stuff that matters.
Re:Everything about Java 8 by pcote on Wednesday March 27, 2013 @12:26PM (#5450342)
>Operator overloading is easy and common in Python, but in my (limited) experience, it's used to create new classes which respond to existing operators with existing semantics, e.g. to make new number classes.

In Python, it's called "special method attributes" and they can do a lot more than just create classes. The __eq__ attribute returns a straight boolean for example in response to the "==" operator. And yes, by the way, you actually can accidentally alter attributes in the calling and callee objects if you aren't careful.

Re:Everything about Java 8 by mikeash on Wednesday March 27, 2013 @02:19PM (#5451087)
Sorry if I was unclear, but I meant that this facility lets you create classes whose instances work like built-in numbers, not that the facility itself is used to create clases somehow.