The best reference I can find is here:
If function is None, the identity function is assumed;
Which means map(None, xs)
essentially makes a lazy, shallow copy of xs
. The confusing thing though is that the shallow copy is immediately iterated in a for
, so it's unnecessary.
My guess: originally, None
was an actual transforming function. They decided they didn't need that transformation any more though (or moved it somewhere else), but left the "skeleton" in place in case they needed to easily reverse the change in the future (although that appears to never have happened). Even that doesn't make perfect sense though, as the whole for loop could have been replaced with a call to list
to force the map
, but hey, people write weird stuff sometimes.
It is not equivalent to list_2 = list_1
though, since that makes the two references point to the same list. It does however seem to be equivalent to either of
list_2 = list(list_1)
list_2 = list_1[:]
Which make shallow copies of list_1
, as mentioned here.