|
|
|
|
|
by nomel
1022 days ago
|
|
‘is’ checks if it the object ids are the same, with None having a unique one. Equals can be tricked. Here’s a class that is equal to None, and everything else: class EqualsEverything:
def __equals__(self, other: Any) -> bool:
return True
|
|
Just curious: would it ever happen in practice?