About 18,100,000 results
Open links in new tab
  1. mean in Python function definitions? - Stack Overflow

    Jan 17, 2013 · In more recent versions of Python >= 3.5, though, it has a defined meaning. PEP 3107 -- Function Annotations described the specification, defining the grammar changes, the …

  2. 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 …

  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. 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 …

  5. 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.

  6. 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.

  7. 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 …

  8. 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 …

  9. How can I use a global variable in a function? - Stack Overflow

    Jul 11, 2016 · In Python, the module is the natural place for global data: Each module has its own private symbol table, which is used as the global symbol table by all functions defined in the …

  10. How do I declare an array in Python? - Stack Overflow

    Aug 23, 2022 · Python has an independent implementation of array() in the standard library module array " array.array() " hence it is incorrect to confuse the two. Lists are lists in python …