|
- oop - Why do you need explicitly have the self argument in a Python . . .
By making the self reference explicit, you're free to refer to any object by that self reference Also, such a way of playing with classes at runtime is harder to do in the more static languages - not that's it's necessarily good or bad It's just that the explicit self allows all this craziness to exist
- Python. Что такое self, наследование и с чем их едят?
Что же такое self, как работает передача определенных значений переменных между функциями и как это все между собой работает? Дело в том, что я задался целью написать небольшую текстовую RPG игру, в
- 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 parameter for a method and got a TypeError, use TypeError: method () takes 1 positional argument but 2 were given instead If OP omitted self in the body of the method and got a NameError, consider How can
- ¿Para qué sirve Self y This en PHP? - Stack Overflow en español
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é
- 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 called class Thanks to inheritance, child classes can override methods and static properties
- 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
- Для чего в python нужен self? - Stack Overflow на русском
Ребят, кто может нормально объяснить для чего в языке python нужен self? Уже несколько статей перечитала и все никак не могу понять Буду крайне благодарна
- Mockito is currently self-attaching to enable the inline-mock-maker . . .
I get this warning while testing in Spring Boot: Mockito is currently self-attaching to enable the inline-mock-maker This will no longer work in future releases of the JDK Please add Mockito as an
|
|
|