I recently inherited a codebase and have just found this code in it:
[] = method_that_empties_a_queue_and_returns_the_contents() # the method isn't called this in real life, but you get the idea
In my real-life code it seems to be used as a way of throwing away a bunch of stuff, a bit like piping to /dev/null
It seems strange to me that something would be assigned to an empty list. Its valid code (i.e. all the tests are passing) but it just seems...weird. [] returns an empty list, but to assign something to it... I don't get it. Anyone care to comment?