When programming Python I sometimes do a **
to make a conversion. I understand what it does but what data structures am I manipulating? A dict
and what is the other? An array
? Is there a name for the **
operator?
|
||||
It's not an operator as such, so it doesn't really have a name, but it is defined as a "syntactic rule". So it should be called:
If you have a list of arguments, If you use it on the left hand side of an In total, there are three types of (single parameter) arguments:
The Most of this can be found in PEPs 0362 and 3102, as well as in the Control Flow section of the docs. It should be noted though that the function signature object PEP is only a draft, and the terminology might just be one person's idea. But they are good terms anyway. :) So the
*: Iterables are objects that implement the |
|||||||||||||
|
I don't think it has a name. In the Python Docs under "Unpacking Argument Lists", it's just referred to as "the I'm not sure what you mean by "the other" data structure. When you do I'll copy the example in the above documentation for clarity.
See also: What does *args and **kwargs mean? |
|||||
|
If you are unsure what to call a particular operator or if it is unnamed, you can always resort to Waka Waka Bang Splat as a reference to help you figure out what to call it. In this case for |
|||
|
protected by gnat Sep 9 at 14:38
Thank you for your interest in this question.
Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.
Would you like to answer one of these unanswered questions instead?
**
. Power and "keyword argument dictionary". Which are you talking about? The documentation has these words: " If the form “**identifier” is present, it is initialized to a new dictionary receiving any excess keyword arguments, defaulting to a new empty dictionary." Which of them seem relevant to your question? – S.Lott Jan 23 '12 at 18:03