About 57 results
Open links in new tab
  1. 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 …

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

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

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

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

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

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

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

  8. ¿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é.

  9. When to use self, &self, &mut self in methods? - Stack Overflow

    Nov 24, 2019 · Self is an alias for the type that the impl block is for. The rules of ownership and borrowing apply to self as they apply to any other parameter (see e.g. this answer). Examples of …

  10. php - When should I use 'self' over '$this'? - Stack Overflow

    self - This refers to the current class name. So self::baz() is the same as Foo::baz() within the Foo class (any method on it). parent - This refers to the parent of the current class. static - This refers to the …