proper name for python * operator?

后端 未结 8 2193
不知归路
不知归路 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:41

    In Ruby and Perl 6 this has been called "splat", and I think most people from those communities will figure out what you mean if you call it that.

    The Python tutorial uses the phrase "unpacking argument lists", which is long and descriptive.

    It is also referred to as iterable unpacking, or in the case of **, dictionary unpacking.

提交回复
热议问题