thanks I see now it was obvious I needed to call the class method to test whether the code worked without self.
2 things remainth :
a.) My point that when a function is called, self is not put in the parameter list, but it does appear in the function definition. This is dumb, and will take some getting used to.
e.g.
The wiki entry on 'this' says that lexical scoping can be used to fix problems that arise in with not having 'this'.
Lexical scoping is something I understand and use. However I don't see how it solves the problem of not having a 'this' because I don't see there's a problem to start with :/
https://en.wikipedia.org/wiki/This_(comp...ogramming)
Let me put it yet another way :
To my mind, 'self' is implicitly called in the variable name
2 things remainth :
a.) My point that when a function is called, self is not put in the parameter list, but it does appear in the function definition. This is dumb, and will take some getting used to.
e.g.
def deposit(self,amount) # 2 parameters when definedbut then when called...
my_account.deposit(10) # 1 parameter when calledb.) Still don't get why self is needed. Seems its a pretty deep routed reason to do with 'decorators', which is a concept i don't know of and have never used. If anyone knows of the simplest example of code or pseudo code that a complier would not be able to understand due to lack of 'self' I'd be interested to see it.
The wiki entry on 'this' says that lexical scoping can be used to fix problems that arise in with not having 'this'.
Lexical scoping is something I understand and use. However I don't see how it solves the problem of not having a 'this' because I don't see there's a problem to start with :/
https://en.wikipedia.org/wiki/This_(comp...ogramming)
Let me put it yet another way :
To my mind, 'self' is implicitly called in the variable name
my_account.deposit(10) # 'my_account' is 'self' !that 'self' doesn't need to be in the parameters is a symptom of self being redundant, but seems the python dev team don't want to accept this !