About 57 results
Open links in new tab
  1. oop - What do __init__ and self do in Python? - Stack Overflow

    Jul 8, 2017 · By convention, this argument is always named self. In the init method, self refers to the newly created object; in other class methods, it refers to the instance whose method was called. …

  2. When do you use 'self' in Python? - Stack Overflow

    Oct 18, 2016 · Are you supposed to use self when referencing a member function in Python (within the same module)? More generally, I was wondering when it is required to use self, not just for methods …

  3. oop - Why do you need explicitly have the "self" argument in a Python ...

    But in some other languages, such as C#, you have a reference to the object that the method is bound to with the "this" keyword without declaring it as an argument in the method prototype. Was this an …

  4. ¿Cuál es la diferencia entre declarar una variable con self '''self ...

    Feb 25, 2016 · Desconozco app-engine, pero el funcionamiento de python es muy claro: self es una referencia a la instancia, self.user_post es un atributo de ella, y user_post (sin self) es una variable …

  5. What is the purpose of the `self` parameter? Why is it needed?

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

  6. ¿Para qué se utiliza self en POO en Python?

    4 El parámetro self se refiere al objeto instanciado de esa clase sobre el cual se está invocando dicho método. Es decir, el objeto que usaste para llamar al método (en tu ejemplo persona1 y persona2).

  7. ¿Para qué sirve Self y This en PHP? - Stack Overflow en español

    Jan 10, 2018 · quería saber el uso de estos dos y sus diferencias. He visto que tienen un uso parecido, pero lo que he visto no explican realmente cuál es mejor usar y por qué.

  8. Чем отличаются static, self и parent в php?

    Feb 18, 2016 · 11 self — класс в котором написано. static — класс в котором выполнилось. Например, если вызвать унаследованный метод в котором self / static, то каждый вариант даст …

  9. Для чего в python нужен self? - Stack Overflow на русском

    Mar 22, 2020 · Ребят, кто может нормально объяснить для чего в языке python нужен self? Уже несколько статей перечитала и все никак не могу понять. Буду крайне благодарна...

  10. Why do I get "TypeError: Missing 1 required positional argument: 'self'"?

    See Why do I get 'takes exactly 1 argument (2 given)' when trying to call a method? for the opposite problem.