0

I have stumbled upon several functions where they are defined as such :

f(x,y, *, z, w, **kwargs)

I was wondering what is the purpose of the asterix * in the middle ?

Is it used to explicitly separate the arguments x, y and the others ? I'm a bit confused on why to put this because we could also remove it like f(x,y, z, w, **kwargs) and would change the behavior of f ?

thmo
  • 139
  • 1
  • 1
  • 9
  • `*` is for *varargs* and `**` is *kwargs*. – tadman Jul 21 '23 at 15:53
  • 1
    [Asterix](https://en.wikipedia.org/wiki/Asterix) is a comic-book indomitable Gaulish warrior. – jarmod Jul 21 '23 at 16:02
  • [Python documentation](https://docs.python.org/3/tutorial/controlflow.html#special-parameters) covers this. – S3DEV Jul 21 '23 at 16:03
  • Duplicate question where the answer is : https://stackoverflow.com/questions/14301967/bare-asterisk-in-function-parameters – thmo Jul 27 '23 at 08:35

0 Answers0