About 53 results
Open links in new tab
  1. python - What do *args and **kwargs mean? - Stack Overflow

    Putting *args and/or **kwargs as the last items in your function definition’s argument list allows that function to accept an arbitrary number of arguments and/or keyword arguments.

  2. python - What is the purpose and use of **kwargs? - Stack Overflow

    Nov 20, 2009 · Notes kwargs is variable name used for keyword arguments, another variable name can be used. The important part is that it's a dictionary and it's unpacked with the double …

  3. How to pass through Python args and kwargs? - Stack Overflow

    May 19, 2014 · While I have a general understanding (I think) of Python's *args and **kwargs, I'm having trouble understanding how to pass them from one function through to another. Here's …

  4. Proper way to use **kwargs in Python - Stack Overflow

    Jul 8, 2009 · What is the proper way to use **kwargs in Python when it comes to default values? kwargs returns a dictionary, but what is the best way to set default values, or is there one? …

  5. python - Use of *args and **kwargs - Stack Overflow

    Is there a simple example to explain how *args and **kwargs are used? Also the tutorial I found used just the "*" and a variable name. Are *args and **kwargs just placeholders or do you use …

  6. python - What does ** (double star/asterisk) and * (star/asterisk) …

    Aug 31, 2008 · The *args and **kwargs are common idioms to allow an arbitrary number of arguments to functions, as described in the section more on defining functions in the Python …

  7. Calling a Python function with *args,**kwargs and optional / …

    And, is there a way to get the behavior I described above (Having *args with default arguments) -- I know I can simulate that behavior by manipulating the kwargs dictionary inside the function.

  8. Why use **kwargs in python? What are some real world …

    Sep 13, 2009 · I come from a background in static languages. Can someone explain (ideally through example) the real world advantages of using **kwargs over named arguments? To me …

  9. python - Что такое *args и **kwargs - Stack Overflow на русском

    Jul 18, 2024 · Две звездочки перед kwargs указывают, что все указанные именованные аргументы превратятся в словарь, где ключом является имя аргумента, а значением …

  10. python - Decorators with parameters? - Stack Overflow

    return fun(*args, **kwargs) return ret_fun real_decorator = partial(_pseudo_decor, argument=arg) @real_decorator def foo(*args, **kwargs): pass Update: Above, foo becomes …