About 27,400,000 results
Open links in new tab
  1. oop - What does 'super' do in Python? - Stack Overflow

    Nov 3, 2015 · When another class subclasses the class you wrote, it could also be inheriting from other classes. And those classes could have an __init__ that comes after this __init__ based on the …

  2. How does the @property decorator work in Python?

    Python has a great concept called property which makes the life of an object-oriented programmer much simpler. Let us assume that you decide to make a class that could store the temperature in degrees …

  3. python - Meaning of @classmethod and @staticmethod for beginner

    Aug 29, 2012 · Here we have __init__, a typical initializer of Python class instances, which receives arguments as a typical instance method, having the first non-optional argument (self) that holds a …

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

  5. What is the difference between @staticmethod and @classmethod in …

    Sep 26, 2008 · What is the difference between a method decorated with @staticmethod and one decorated with @classmethod?

  6. python - What is the purpose of the `self` parameter? Why is it needed ...

    A class (instance) method has to be aware of it's parent (and parent properties) so you need to pass the method a reference to the parent class (as self). It's just one less implicit rule that you have to …

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

    Double Underscore (Name Mangling) From the Python docs: Any identifier of the form __spam (at least two leading underscores, at most one trailing underscore) is textually replaced with …

  8. python - Calling parent class __init__ with multiple inheritance, what ...

    Because of the way diamond inheritance works in python, classes whose base class is object should not call super().__init__(). As you've noticed, doing so would break multiple inheritance because you end …

  9. class - Understanding Python super () with __init__ () methods - Stack ...

    Feb 23, 2009 · In Python 2, we were required to call super like this with the defining class's name and self, but we'll avoid this from now on because it's redundant, slower (due to the name lookups), and …

  10. python - Class (static) variables and methods - Stack Overflow

    Sep 16, 2008 · See what the Python tutorial has to say on the subject of classes and class objects. @Steve Johnson has already answered regarding static methods, also documented under "Built-in …