About 30,500 results
Open links in new tab
  1. python - What is the purpose of the `self` parameter ... - Stack …

    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 …

  2. oop - What do __init__ and self do in Python? - Stack Overflow

    Jul 8, 2017 · Python adds the self argument to the list for you; you do not need to include it when you call the methods. if you didn't provide self in init method then you will get an error

  3. Difference between Module and Class in Python - Stack Overflow

    Aug 24, 2022 · There are huge differences between classes and modules in Python. Classes are blueprints that allow you to create instances with attributes and bound functionality. Classes …

  4. Understanding Python super() with __init__() methods

    Feb 23, 2009 · Just a heads up... with Python 2.7, and I believe ever since super() was introduced in version 2.2, you can only call super() if one of the parents inherit from a class that eventually …

  5. Understanding the main method of python - Stack Overflow

    I am new to Python, but I have experience in other OOP languages. My course does not explain the main method in python. Please tell me how main method works in python ? I am confused …

  6. python - What is the meaning of single and double underscore …

    This naming convention is used by python to define variables internally. Avoid using this convention to prevent name conflicts that could arise with python updates. Dunder variables …

  7. What is the difference between objects and classes in Python?

    Jun 30, 2024 · I was wondering what is the difference between objects and classes in python? I thought all classes are objects, but in that case, author wouldn't have used phrase "classes …

  8. struct - C-like structures in Python - Stack Overflow

    Aug 30, 2008 · With the introduction of Data Classes in Python 3.7 we get very close. The following example is similar to the NamedTuple example below, but the resulting object is …

  9. Python - Classes and OOP Basics - Stack Overflow

    Apr 4, 2012 · I do not fully understand classes. I have read the python documentation and several other tutorials. I get the basic gist of it but don't understand the nuance. For instance in my …

  10. oop - What are metaclasses in Python? - Stack Overflow

    First, you know that classes are objects that can create instances. Well, in fact, classes are themselves instances. Of metaclasses. >>> class Foo(object): pass >>> id(Foo) 142630324 …