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
Name mangling example in Python tutorial #65395
Comments
The example used for demonstrating name mangling could be better if two versions of code are shown - one with name mangling and one without. I have modified the original example to incorporate this (see attached). |
Adding the second code sample, since only one attachment allowed at one go. |
Here is a link to the documentation section in question: https://docs.python.org/2/tutorial/classes.html#private-variables-and-class-local-references |
Thanks for the report and proposed fix! Could you upload a patch file that we could directly apply to the documentation instead of Python files? More information about how to do that is found here: https://docs.python.org/devguide/#quick-start If you need any kind of help, the devguide has the address of the core-mentorship mailing list where many friendly people can answer questions. You can also ask in this issue page. |
Uploading the patch for the improvement to the name mangling section of the Python tutorial. Please note that the modification is much smaller than I proposed earlier. |
I think the text is fine, but the example is not needed. I've updated Chandan's patch to remove the example and tweak the text a bit. |
Chandan or Berker, Any interest in making a Github pull request for this patch? |
I don't think we should advertise how to manually mangle the names. That isn't a best practice. The feature is automatic for a reason. |
What should we do with this issue? Raymond, it sounds like you think the proposed PR should not be merged, is that right? If so, should the issue and PR be closed? Other opinions? I would like to resolve this so we can either merge or close PR 5667. Thanks! |
Berker Peksag's change (PR 5667) is very simple and, I think, helpful. |
Thanks Chandan Kumar and Berker Peksag. The documentation has been clarified. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: