On Sat, Oct 31, 2020 at 9:37 PM Guido van Rossum firstname.lastname@example.org wrote:
I think this over-stresses the notion that users might want to override the comparison operator to be used. We only have two operators that make sense in this context, 'is' and '==', and really, for almost everything you want to do, '==' is the appropriate operator. (There is a small trickle of bugs caused by people inappropriately using e.g. `if x is 1` instead of `if x == 1`, suggesting that if anything, there is too much freedom here.) The big exception is `None`, where you basically always want to use `is`, which is what PEP 634 does.
FWIW, there's an additional exception: sentinel = object()
if var is sentinel:
I use this idiom from time to time - instead of None.