About 5,810,000 results
Open links in new tab
  1. What does -> mean in Python function definitions? - Stack Overflow

    Jan 17, 2013 · In Python 3.5 though, PEP 484 -- Type Hints attaches a single meaning to this: -> is used to indicate the type that the function returns. It also seems like this will be enforced in …

  2. python - What do * (single star) and / (slash) do as independent ...

    Jan 9, 2020 · The function parameter syntax (/) is to indicate that some function parameters must be specified positionally and cannot be used as keyword arguments. (This is new in Python …

  3. How do I declare custom exceptions in modern Python?

    By "modern Python" I mean something that will run in Python 2.5 but be 'correct' for the Python 2.6 and Python 3.* way of doing things. And by "custom" I mean an Exception object that can …

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

    Functions, in Python, are first class objects - which means you can pass a function as an argument to another function, and return functions. Decorators do both of these things.

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

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

  6. What does asterisk * mean in Python? - Stack Overflow

    Does * have a special meaning in Python as it does in C? I saw a function like this in the Python Cookbook: def get (self, *a, **kw) Would you please explain it to me or point out where I can …

  7. python - What do *args and **kwargs mean? - Stack Overflow

    What exactly do *args and **kwargs mean? According to the Python documentation, from what it seems, it passes in a tuple of arguments. def foo (hello, *args): print (hello) for each in args:...

  8. python - What is the purpose of the `self` parameter? Why is it …

    For a language-agnostic consideration of the design decision, see What is the advantage of having this/self pointer mandatory explicit?. To close debugging questions where OP omitted a …

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

    Aug 31, 2008 · See What do ** (double star/asterisk) and * (star/asterisk) mean in a function call? for the complementary question about arguments.

  10. python - What are iterator, iterable, and iteration? - Stack Overflow

    In Python, iterable is an object that is, well, iterable, which simply put, means that it can be used in iteration, e.g. with a for loop. How? By using iterator. I'll explain below. ... while iterator is an …