I am new to Python. While reading some code, I come across what is equivalent of following:
>>> from collections import namedtuple
>>> Point = namedtuple('Point', ['x', 'y'])
>>> a=(10,20)
>>> Point(*a)
Point(x=10, y=20)
Here, I do not understand, what is the meaning of passing (*a) to object Point in the last line. I tried searching in the python documentation for “pass by reference”, “pointers”, “operator overloading” but could not find much.
Thanks.
A
*in a function name is used to unpack argument lists