I just randomly observed the following in Python and am curious to know the reason why this evaluates to False
:
list(list()) == [[]]
Interestingly if you rearrange the syntax in the following ways, the first way evaluates as False
, but the second as True
:
list([]) == [[]]
[list()] == [[]]
What is going on under the hood here?