Does "map" destroy its input?
I write the following in the SageMath cloud:
Bob="xyz"
sB = subsets(Bob)
print map(str, sB)
print map(str, sB)
and the output is:
['[]', "['x']", "['y']", "['x', 'y']", "['z']", "['x', 'z']", "['y', 'z']", "['x', 'y', 'z']"]
[]
I.e, after the first "map", the variable "sB" becomes empty!
Why does this happen?