proper name for python * operator?

后端 未结 8 2149
不知归路
不知归路 2020-11-22 07:20

What is the correct name for operator *, as in function(*args)? unpack, unzip, something else?

8条回答
  •  执笔经年
    2020-11-22 07:40

    For a colloquial name there is "splatting".

    For arguments (list type) you use single * and for keyword arguments (dictionary type) you use double **.

    Both * and ** is sometimes referred to as "splatting".

    See for reference of this name being used: https://stackoverflow.com/a/47875892/14305096

提交回复
热议问题