Why does applying the star operator to the values in dict_items within a comprehension wrap each value in a list?

Viewed 26

I ran the following in the python3 interpreter:

>>> d = dict( a=1, b=2 )
>>> [v for k,*v in d.items()]
[[1], [2]]

Why does using the star operator in this context cause each value to get wrapped in a list?

0 Answers
Related