Dec
24
How to use your self
There are a lot of questions on StackOverflow asking "what's the deal with self?"
Many of them are asking a language-design question: Why does Python require explicit self when other languages like C++ and friends (including Java), JavaScript, etc. do not? Guido has answered that question many times, most recently in Why explicit self has to stay.
But some people are asking a more practical question: Coming from a different language (usually Java), they don't know how to use self properly.
Many of them are asking a language-design question: Why does Python require explicit self when other languages like C++ and friends (including Java), JavaScript, etc. do not? Guido has answered that question many times, most recently in Why explicit self has to stay.
But some people are asking a more practical question: Coming from a different language (usually Java), they don't know how to use self properly.