by Timothycquinn · 3y ago · 0 comments
I can see usecases but clearly it should be used sparingly.
It’s interesting to learn about how the interpreter is implemented, but that’s about it.
Although I have written over a hundred thousand of lines of code in Python over the years; I use Python mostly for dev ops tooling, reporting, monitoring and automation so they don't get super complex and they mostly can lean on procedural programming patterns.
I could imagine complex frameworks needing heavy use of Objects that could lean on the 'is' keyword.
Here’s a class that is equal to None, and everything else:
class EqualsEverything:
def __equals__(self, other: Any) -> bool:
return TrueJust curious: would it ever happen in practice?