About 50 results
Open links in new tab
  1. What does -> mean in Python function definitions?

    Jan 17, 2013 · 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 the …

  2. 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. If we stack decorators, the …

  3. 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 so be careful …

  4. python - Attribute definition - Stack Overflow

    Mar 13, 2020 · I am currently writing a paper on python fundamentals and I need some help on it as I could not find a single consistent definition for Attribute class Person: def __init__(self,weight):

  5. 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 include extra …

  6. How to see the source code inside the library when doing ctrl+click (go ...

    Jan 15, 2025 · 10 I know that in VS Code, we can find the definition of variable/function by ctrl + clicking. Ctrl + click also supports that for variables/functions declared inside the libraries we've installed (e.g. …

  7. No definition found for function - VSCode Python

    Oct 8, 2020 · I am using VSCode for Python along with the Microsoft for Python extension enabled in VSCode. For Python v3.9.0 I am getting No definition found if I try to seek a function definition. …

  8. python - How do I split the definition of a long string over multiple ...

    The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping …

  9. Python class definition syntax - Stack Overflow

    6 A class definition is a bit different from a function/method definition. The parentheses in class definitions are for defining from which class you inherit. You don't write def in front of it, and when …

  10. python - Define a method outside of class definition? - Stack Overflow

    May 26, 2018 · Python isn't like Java or C# and you can just have functions that aren't part of any class. If you want to group together functions you can just put them together in the same module, and you …