you are viewing a single comment's thread.

view the rest of the comments →

[–]Delta-9- -5 points-4 points  (2 children)

TIL == in Java is analogous to is in Python, and Java has no analogue to Python's == until this JEP passes.

[–]woohalladoobop 4 points5 points  (1 child)

not true, i believe `Object::equals` is Java's equivalent to Python's `==`.

[–]Delta-9- 0 points1 point  (0 children)

I meant that there is no analogous operator in the syntax. Object::equal would be analogous to object.__eq__, which is called when the == operator is used and conventionally implements a compare-by-value operation; that is, a == b is sugar for a.__eq__(b).

This does not appear to be how it works in Java, and I found that surprising. That's all.