Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I don't think it has a name. In the Python Docs under "Unpacking Argument Lists", it's just referred to as "the **-operator."

I'm not sure what you mean by "the other" data structure. When you do f(**kwargs) you unpack the dictionary kwargs as a sequence of key-value pairs. I don't see that there's another structure involved.

I'll copy the example in the above documentation for clarity.

>>> def parrot(voltage, state='a stiff', action='voom'): ... print "-- This parrot wouldn't", action, ... print "if you put", voltage, "volts through it.", ... print "E's", state, "!" ... >>> d = {"voltage": "four million", "state": "bleedin' demised", "action": "VOOM"} >>> parrot(**d) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 

See also: What does *args and **kwargs mean?What does *args and **kwargs mean?

I don't think it has a name. In the Python Docs under "Unpacking Argument Lists", it's just referred to as "the **-operator."

I'm not sure what you mean by "the other" data structure. When you do f(**kwargs) you unpack the dictionary kwargs as a sequence of key-value pairs. I don't see that there's another structure involved.

I'll copy the example in the above documentation for clarity.

>>> def parrot(voltage, state='a stiff', action='voom'): ... print "-- This parrot wouldn't", action, ... print "if you put", voltage, "volts through it.", ... print "E's", state, "!" ... >>> d = {"voltage": "four million", "state": "bleedin' demised", "action": "VOOM"} >>> parrot(**d) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 

See also: What does *args and **kwargs mean?

I don't think it has a name. In the Python Docs under "Unpacking Argument Lists", it's just referred to as "the **-operator."

I'm not sure what you mean by "the other" data structure. When you do f(**kwargs) you unpack the dictionary kwargs as a sequence of key-value pairs. I don't see that there's another structure involved.

I'll copy the example in the above documentation for clarity.

>>> def parrot(voltage, state='a stiff', action='voom'): ... print "-- This parrot wouldn't", action, ... print "if you put", voltage, "volts through it.", ... print "E's", state, "!" ... >>> d = {"voltage": "four million", "state": "bleedin' demised", "action": "VOOM"} >>> parrot(**d) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 

See also: What does *args and **kwargs mean?

added 2 characters in body
Source Link
Kris Harper
  • 2.3k
  • 2
  • 19
  • 22

I don't think it has a name. In the Python Docs under "Unpacking Argument Lists", itit's just referred to as "the **-operator."

I'm not sure what you mean by "the other" data structure. When you do f(**kwargs) you unpack the dictionary kwargs as a sequence of key-value pairs. I don't see that there's another structure involved.

I'll copy the example in the above documentation for clarity.

>>> def parrot(voltage, state='a stiff', action='voom'): ... print "-- This parrot wouldn't", action, ... print "if you put", voltage, "volts through it.", ... print "E's", state, "!" ... >>> d = {"voltage": "four million", "state": "bleedin' demised", "action": "VOOM"} >>> parrot(**d) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 

See also: What does *args and **kwargs mean?

I don't think it has a name. In the Python Docs under "Unpacking Argument Lists", it just referred to as "the **-operator."

I'm not sure what you mean by "the other" data structure. When you do f(**kwargs) you unpack the dictionary kwargs as a sequence of key-value pairs. I don't see that there's another structure involved.

I'll copy the example in the above documentation for clarity.

>>> def parrot(voltage, state='a stiff', action='voom'): ... print "-- This parrot wouldn't", action, ... print "if you put", voltage, "volts through it.", ... print "E's", state, "!" ... >>> d = {"voltage": "four million", "state": "bleedin' demised", "action": "VOOM"} >>> parrot(**d) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 

See also: What does *args and **kwargs mean?

I don't think it has a name. In the Python Docs under "Unpacking Argument Lists", it's just referred to as "the **-operator."

I'm not sure what you mean by "the other" data structure. When you do f(**kwargs) you unpack the dictionary kwargs as a sequence of key-value pairs. I don't see that there's another structure involved.

I'll copy the example in the above documentation for clarity.

>>> def parrot(voltage, state='a stiff', action='voom'): ... print "-- This parrot wouldn't", action, ... print "if you put", voltage, "volts through it.", ... print "E's", state, "!" ... >>> d = {"voltage": "four million", "state": "bleedin' demised", "action": "VOOM"} >>> parrot(**d) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 

See also: What does *args and **kwargs mean?

I don't think it has a name. In the The PythonPython Docs under "Unpacking Argument Lists", it just referreferred to it as "the **-operator."

I'm not sure what you mean by "the other" data structure. When you do f(**kwargs) you unpack the dictionary kwargs as a sequence of key-value pairs. I don't see that there's another structure involved.

I'll copy the exampleexample in the above documentation for clarity.

>>> def parrot(voltage, state='a stiff', action='voom'): ... print "-- This parrot wouldn't", action, ... print "if you put", voltage, "volts through it.", ... print "E's", state, "!" ... >>> d = {"voltage": "four million", "state": "bleedin' demised", "action": "VOOM"} >>> parrot(**d) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 

See also: http://stackoverflow.com/q/287085/817630What does *args and **kwargs mean?

I don't think it has a name. The Python Docs just refer to it as "the **-operator."

I'm not sure what you mean by "the other" data structure. When you do f(**kwargs) you unpack the dictionary kwargs as a sequence of key-value pairs. I don't see that there's another structure involved.

I'll copy the example in the above documentation for clarity.

>>> def parrot(voltage, state='a stiff', action='voom'): ... print "-- This parrot wouldn't", action, ... print "if you put", voltage, "volts through it.", ... print "E's", state, "!" ... >>> d = {"voltage": "four million", "state": "bleedin' demised", "action": "VOOM"} >>> parrot(**d) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 

See also http://stackoverflow.com/q/287085/817630

I don't think it has a name. In the Python Docs under "Unpacking Argument Lists", it just referred to as "the **-operator."

I'm not sure what you mean by "the other" data structure. When you do f(**kwargs) you unpack the dictionary kwargs as a sequence of key-value pairs. I don't see that there's another structure involved.

I'll copy the example in the above documentation for clarity.

>>> def parrot(voltage, state='a stiff', action='voom'): ... print "-- This parrot wouldn't", action, ... print "if you put", voltage, "volts through it.", ... print "E's", state, "!" ... >>> d = {"voltage": "four million", "state": "bleedin' demised", "action": "VOOM"} >>> parrot(**d) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 

See also: What does *args and **kwargs mean?

Source Link
Kris Harper
  • 2.3k
  • 2
  • 19
  • 22
Loading