About 50 results
Open links in new tab
  1. python - What does ** (double star/asterisk) and * (star/asterisk) do ...

    Aug 31, 2008 · Note: A Python dict, semantically used for keyword argument passing, is arbitrarily ordered. However, in Python 3.6+, keyword arguments are guaranteed to remember insertion order. …

  2. What does -> mean in Python function definitions?

    Jan 17, 2013 · 744 It's a function annotation. In more detail, Python 2.x has docstrings, which allow you to attach a metadata string to various types of object. This is amazingly handy, so Python 3 extends …

  3. Purpose of @ symbols in Python? - Stack Overflow

    Jun 2, 2009 · Python decorators add extra functionality to another function. An italics decorator could be like def makeitalic(fn): def newFunc(): return "<i>" + fn() + "</i>" return newFunc Note that a function …

  4. python - How do I define a function with optional arguments? - Stack ...

    467 I have a Python function which takes several arguments. Some of these arguments could be omitted in some scenarios.

  5. python - Why do some functions have underscores "__" before and …

    May 24, 2024 · In Python, the use of an underscore in a function name indicates that the function is intended for internal use and should not be called directly by users. It is a convention used to indicate …

  6. python - What do ** (double star/asterisk) and * (star/asterisk) mean ...

    May 27, 2010 · In a function definition, it's the other way around: the single star turns an arbitrary number of arguments into a list, and the double start turns an arbitrary number of keyword …

  7. What does the "at" (@) symbol do in Python? - Stack Overflow

    An @ symbol at the beginning of a line is used for class and function decorators: PEP 318: Decorators Python Decorators - Python Wiki The most common Python decorators are: @property …

  8. How do Python functions handle the types of parameters that you pass …

    Nov 18, 2021 · Python doesn't know that you are calling the function with the proper types, and expects the programmer to take care of that. If your function will be called with different types of parameters, …

  9. Passing functions with arguments to another function in Python?

    Is it possible to pass functions with arguments to another function in Python? Say for something like: def perform (function): return function () But the functions to be passed will have argume...

  10. python - How do I get ("return") a result (output) from a function? How ...

    The natural, simple, direct, explicit way to get information back from a function is to return it. Broadly speaking, the purpose of a function is to compute a value, and return signifies "this is the value we …