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

Name mangling example in Python tutorial #65395

Closed
chandan mannequin opened this issue Apr 10, 2014 · 15 comments
Closed

Name mangling example in Python tutorial #65395

chandan mannequin opened this issue Apr 10, 2014 · 15 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@chandan
Copy link
Mannequin

chandan mannequin commented Apr 10, 2014

BPO 21196
Nosy @tim-one, @rhettinger, @vstinner, @ned-deily, @merwok, @berkerpeksag, @csabella, @miss-islington
PRs
  • bpo-21196: Clarify name mangling rules in tutorial #5667
  • [3.7] bpo-21196: Clarify name mangling rules in tutorial (GH-5667) #9986
  • [3.6] bpo-21196: Clarify name mangling rules in tutorial (GH-5667) #9987
  • [2.7] bpo-21196: Clarify name mangling rules in tutorial (GH-5667) #9988
  • Files
  • name_mangling_works.py
  • without_name_mangling.py
  • docs_name_mangling.patch
  • issue21196.diff
  • 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:

    assignee = None
    closed_at = <Date 2018-10-20.00:53:09.354>
    created_at = <Date 2014-04-10.12:31:20.343>
    labels = ['3.8', 'type-feature', '3.7', 'docs']
    title = 'Name mangling example in Python tutorial'
    updated_at = <Date 2018-10-20.00:53:09.302>
    user = 'https://bugs.python.org/chandan'

    bugs.python.org fields:

    activity = <Date 2018-10-20.00:53:09.302>
    actor = 'vstinner'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2018-10-20.00:53:09.354>
    closer = 'vstinner'
    components = ['Documentation']
    creation = <Date 2014-04-10.12:31:20.343>
    creator = 'chandan'
    dependencies = []
    files = ['34781', '34782', '34814', '43108']
    hgrepos = []
    issue_num = 21196
    keywords = ['patch']
    message_count = 15.0
    messages = ['215872', '215874', '215875', '215960', '216068', '266912', '312137', '312158', '318891', '318893', '328102', '328104', '328106', '328108', '328117']
    nosy_count = 10.0
    nosy_names = ['tim.peters', 'rhettinger', 'vstinner', 'ned.deily', 'eric.araujo', 'docs@python', 'berker.peksag', 'chandan', 'cheryl.sabella', 'miss-islington']
    pr_nums = ['5667', '9986', '9987', '9988']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue21196'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    @chandan
    Copy link
    Mannequin Author

    chandan mannequin commented Apr 10, 2014

    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).

    @chandan chandan mannequin assigned docspython Apr 10, 2014
    @chandan chandan mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Apr 10, 2014
    @chandan
    Copy link
    Mannequin Author

    chandan mannequin commented Apr 10, 2014

    Adding the second code sample, since only one attachment allowed at one go.

    @chandan
    Copy link
    Mannequin Author

    chandan mannequin commented Apr 10, 2014

    Here is a link to the documentation section in question: https://docs.python.org/2/tutorial/classes.html#private-variables-and-class-local-references

    @merwok
    Copy link
    Member

    merwok commented Apr 12, 2014

    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.

    @chandan
    Copy link
    Mannequin Author

    chandan mannequin commented Apr 14, 2014

    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.

    @berkerpeksag
    Copy link
    Member

    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.

    @csabella
    Copy link
    Contributor

    Chandan or Berker,

    Any interest in making a Github pull request for this patch?

    @csabella csabella added 3.7 (EOL) end of life 3.8 only security fixes labels Feb 13, 2018
    @rhettinger
    Copy link
    Contributor

    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.

    @ned-deily
    Copy link
    Member

    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!

    @tim-one
    Copy link
    Member

    tim-one commented Jun 7, 2018

    Berker Peksag's change (PR 5667) is very simple and, I think, helpful.

    @vstinner
    Copy link
    Member

    New changeset 13ae4d4 by Victor Stinner (Berker Peksag) in branch 'master':
    bpo-21196: Clarify name mangling rules in tutorial (GH-5667)
    13ae4d4

    @miss-islington
    Copy link
    Contributor

    New changeset 3e5bcd1 by Miss Islington (bot) in branch '3.7':
    bpo-21196: Clarify name mangling rules in tutorial (GH-5667)
    3e5bcd1

    @miss-islington
    Copy link
    Contributor

    New changeset efc09a9 by Miss Islington (bot) in branch '3.6':
    bpo-21196: Clarify name mangling rules in tutorial (GH-5667)
    efc09a9

    @miss-islington
    Copy link
    Contributor

    New changeset b0f7fa1 by Miss Islington (bot) in branch '2.7':
    bpo-21196: Clarify name mangling rules in tutorial (GH-5667)
    b0f7fa1

    @vstinner
    Copy link
    Member

    Thanks Chandan Kumar and Berker Peksag. The documentation has been clarified.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    8 participants