When I was trying to figure out the use of imp.load_module in Python, I got the following code (origin page). It’s my first time seeing the use of * in Python, is that some pointer like things?
thanks in advance
import imp
import dbgp
info = imp.find_module(modname, dbgp.__path__)
_client = imp.load_module(modname, *info)
sys.modules["_client"] = _client
from _client import *
del sys.modules["_client"], info, _client
The
*on front ifinfocauses the list / tuple to be unwrapped into individual arguments to the function. You can read more about unpacking here in the python documentation. this can also be done with dictionaries for named arguments, see hereFor example,
Output:
EDIT:
According to comments to your question by jcomeau_ictx, the operator is called
splat