1] What does this program do?
print object() > object()1] What does this program do?
print object() > object() >>> print(object() > object())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unorderable types: object() > object()
Yet another reason to upgrade to Python 3! :)You're creating two objects (with random addresses, which affect the __str__ method result, which in turn result in a string comparison that returns False or True)
i.e. it's a differentiator to what is or isn't Perl.
A more realistic example: inner classes can't see class variables from their enclosing classes. (Why enclose classes? - builder pattern)
Yes, you can learn to deal with it, but that doesn't mean it wasn't a bad design choice. If both forms of equality are required to be operators, == and === should have been swapped. Too late to do it now, woulda, coulda, shoulda, but it certainly is, IMO, a "bad design" smell in the language, and hardly the only one that still bites people.
Another example: the way 'this' scoping works is similarly busted in that while the rules for it are reasonably straightforward in isolation, it is different enough compared to other languages that share the same basic keywords and syntax that it should have been called something else.
To be fair, I don't think much of this has to do with Brendan Eich being a bad PL designer as much as it has to do with the odd history of JavaScript that is still represented in the name of the language ("Take this client language you made which has no connection to Java, and make it look kinda like Java, please!").