2 ms·
Just to be clear, risking of stating the obvious, when I wrote "overloaded", I was talking about operator overloading. In both C++ and Python, == can be overlo
by jraph 4y ago
Just to be clear, risking of stating the obvious, when I wrote "overloaded", I was talking about operator overloading.
In both C++ and Python, == can be overloaded, so if you need to be sure you are not dealing with an overloaded equality, "is" is convenient in Python. I'm not sure what I would do in C++, and I could imagine a world where "is" in C++ was like "==", but guaranteed to not be overloaded.
Of course, Python can't reserve "to be".
- avgcorrection 4y agoJust to be clear: “to be” refers to the English language (no “to be” operator or this and that in programming). “Overloaded” means that it can mean a whole bunch of different things. This should be obvious from context.
- jraph 4y ago> This should be obvious from context Yes, I understood your comment. It's just that since you used the same word as me but with a different meaning, I wanted to make sure there was no misunderstanding.