In Python 3, the following returns a map object:
map(lambda x: x**2, range(10))
If we want to turn this object into a list, we can just cast it as a list using list(mapobject). However, I discovered through code golfing that
*x, = mapobject
makes x into a list. Why is this allowed in Python 3?
*x, = iterablesyntax, I don't think someone else looking for an answer to Sandeep's question would find it as easily there as here. Thanks for not immediately hammering it, anyway ... I'll take this to chat and see what a larger group thinks.