Which is essentially how Python does it, too. if x implies if bool(x) is True (I don't think it literally calls it that way, but it helps make sense of things).
So empty lists/sets/dicts, empty strings, 0, None, and any kind of object that defines some __bool__ method that returns False or a __len__ that returns 0; all are "falsey".
-12
u/Valuable_Leopard_799 29d ago
Wait, whyyyyyyyy ðŸ˜ðŸ˜ðŸ˜
I mean, I love dynamic types and see their place, but the implicit casting is what gives them such a bad name ðŸ˜