Feb-18-2019, 10:07 PM
Global variables are easy to avoid.
This doesn't make any sense. You seem to be talking about Java style security for classes. Python does not have that, but that has nothing to do with self. You need to use self to clarify that you are accessing an attribute of the instance.
Python is and always has been a multi-paradigm language with OOP included. I don't know where you got the idea that OOP was duct-taped on.
(Feb-18-2019, 08:51 PM)PatM Wrote: If I write a class for others to use I have no control over how they use variable so from what I can tell I'm stuck writing self in front of every variable.
This doesn't make any sense. You seem to be talking about Java style security for classes. Python does not have that, but that has nothing to do with self. You need to use self to clarify that you are accessing an attribute of the instance.
Python is and always has been a multi-paradigm language with OOP included. I don't know where you got the idea that OOP was duct-taped on.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures