Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python does not have private #224

Open
meltinglava opened this issue Sep 15, 2017 · 3 comments
Open

Python does not have private #224

meltinglava opened this issue Sep 15, 2017 · 3 comments

Comments

@meltinglava
Copy link

http://newcoder.io/gui/part-2/ says " We can do this by creating a private function " . But it is not actually private. It just says that if you refer to that function, you will get your version of that function, and not the subclassers verson, if he also have made a function with the same name.

@merwok
Copy link
Contributor

merwok commented Sep 15, 2017

Yes, that’s what private means in Python. It’s important to learn how Python deliberately lets you reach into internals and prefers «consenting adults» over over-rigid enforcement, but I don’t know if this tutorial is the right place for that. What do you think? Were you misled or confused by the text?

@meltinglava
Copy link
Author

I think that we should not use the word private, as it's meaning is so vastly differente from other programming languages. And does it actually matter here. Are we ever suspecting that this is ever going to get subclassed?

@merwok
Copy link
Contributor

merwok commented Sep 20, 2017

I would approve a change from «private method» to «internal method» and replacing the double dash with just one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants