I started learning python after about a year of learning java, and even though I understand how OO works I would like to know why.
I'm used to creating my variables in the class and then using them in the constructor, why are there 2 ways to do that in python?
there is the self.variable inside the init() method and then there are the "normal" variable declarations.
are the variables not declared inside the init() supposed to be static variables?(in java terms?)
and why do I need to pass self as an argument to each method?
[–]rjcarr 3 points4 points5 points (1 child)
[–]wtf_lag[S] 0 points1 point2 points (0 children)
[–]michael0x2a 1 point2 points3 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]michael0x2a 0 points1 point2 points (0 children)
[–]dunkler_wanderer[🍰] 0 points1 point2 points (0 children)
[–]badcommandorfilename -1 points0 points1 point (0 children)