5 ms·
I think this refers to encapsulation in Python, 'private' methods aren't really private, any user can poke around in there. Old justification: https://mail.pyt
by a_bonobo 1y ago
I think this refers to encapsulation in Python, 'private' methods aren't really private, any user can poke around in there.
Old justification: https://mail.python.org/pipermail/tutor/2003-October/025932.html https://mail.python.org/pipermail/tutor/2003-October/025932....
>Nothing is really private in python. No class or class instance can
keep you away from all what's inside (this makes introspection
possible and powerful). Python trusts you. It says "hey, if you want
to go poking around in dark places, I'm gonna trust that you've got
a good reason and you're not making trouble."
>After all, we're all consenting adults here.
- johannes1234321 1y agoI don't think that is the relevant point. Smalltalk doesn't have visibility either. The difference is that in smalltalk everything is a message. Operators are messages to an object. Even things we commonly assume to be control structures in other languages like if or while (or rather ifTrue, whileTrue) are messages. Python is a lot less "pure" but so are all commonly used OO languages.