##########################################################################
But you can read my posts ;-) I quote myself:
##########################################################################
##########################################################################
Now answering to sinoroc:
##########################################################################
A big portion of refactoring activities is moving and renaming things
##########################################################################
Yeah, I completely agree. It’s also funny. It’s like tidy up your house after a crazy party.
##########################################################################
where one would wrap
_xwith apropertyto make it public instead of renaming_xtox
##########################################################################
Not saying that. I’m saying that you can name your private members local x or local fun() instead of _x and _fun(). If you want to make them public, you have just to remove local.
##########################################################################
Tools have been able to do this kind of refactoring for decades.
Yeah, it was already said, and my reply was: if so, also debugging a private member and modify it has powerful tools that exists from a lot of time.
I would like also that local will make the variable “really” private. Terry said there was already discussed – and I don’t find it suprising… But I found only this:
https://discuss.python.org/search?q=private%20%23ideas%20in%3Atitle%20order%3Alatest
I quote some of the posts I find they have some good counterpoints:
Perhaps because how inconvenient they are if you want to break abstractions (and you need to do this all the time for debugging, testing, and “temporary” fixes).
people can extend functionality, or more easily work around bugs, because they have access to those private/internal data and functions.
This is true. The fact that _x is not special at all and you can access it easily as x is good if you want a fast debug and test. And it’s true you can workaround bugs more easily. I remember I’ve done it for a public py library. I had to read a private member to patch my app (app is so cool to say instead of program now… maybe because is Unix like. Only three letters).
But it’s really easy to read and modify also a “real” private member. That’s a piece of cake.