Closed inglesp closed 9 years ago
The question might be interpreted as asking for a single expression, replacing ???
in the example. But you can do it with a single expression too:
>>> x = type("", (), {'__lt__': lambda self, other: True})()
>>> x < x
True
Came here to file this exact issue, yep.
Guess that example questions still follow "Details and scope" written below, so: https://github.com/cosmologicon/pywat/blob/master/quiz.md#details-and-scope
In particular, the following are out of scope, and are not valid as missing values:
- user-defined classes
lambda
s
I agree with @peter50216, I was about to write the same answer
I feel that, if you have to say, "does anything satisfy the following, except these things that do satisfy it?", the question should probably be scrapped completely.
It's there to frame the question and narrow the challenge around specific Python objects.
The reason for the restriction is to avoid trick questions. Most people would probably consider type("", (), {'__lt__': lambda self, other: True})()
to be a trick answer. And I'm not trying to trick people: I only want to ask questions where the answer is something reasonable.
Something where you have to come up with weird tricks like that would be fun, but it wouldn't actually test knowledge of Python edge cases, which is the whole point of the quiz.
I've added this example to the quiz instructions, and tried to explain why it's considered out of scope. Hopefully that clears up the confusion.
You claim that
x < x
is impossible, but it's not: