[issue12086] Tutorial doesn't discourage name mangling

2011-06-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Added an example of how to use double underscores correctly. I agree with Ezio that the rest of the documentation is clear on the subject. -- resolution: -> rejected status: open -> closed ___ Python tracker

[issue12086] Tutorial doesn't discourage name mangling

2011-06-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 79f9698777b7 by Raymond Hettinger in branch '3.2': Issue 12086: add example showing how to use name mangling. http://hg.python.org/cpython/rev/79f9698777b7 New changeset fca745bc70be by Raymond Hettinger in branch 'default': Issue 12086: add exampl

[issue12086] Tutorial doesn't discourage name mangling

2011-06-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 68bc3c5960a4 by Raymond Hettinger in branch '2.7': Issue 12086: add example showing how to use name mangling. http://hg.python.org/cpython/rev/68bc3c5960a4 -- nosy: +python-dev ___ Python tracker

[issue12086] Tutorial doesn't discourage name mangling

2011-05-23 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue12086] Tutorial doesn't discourage name mangling

2011-05-17 Thread Ezio Melotti
Ezio Melotti added the comment: FWIW that section used to be called "Private variables through name mangling" back in 1.5, and started by saying "There is now limited support for class-private identifiers.". PEP8 [0] also talks about the name mangling in several places, and carefully avoids

[issue12086] Tutorial doesn't discourage name mangling

2011-05-17 Thread Radomir Dopieralski
Radomir Dopieralski added the comment: I am reporting this specifically because I just had two independent cases of people who submitted code that had almost all methods name-mangled (within 2 weeks), and who then pointed to that section of the tutorial as justification. I have a hard time co

[issue12086] Tutorial doesn't discourage name mangling

2011-05-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is a venerable section of the tutorial that has been exposed to many, many readers and AFAICT it has never caused a problem. So, I see no need to make a change to it. Also as Georg points out, the docs (especially the tutorial) are not about discour

[issue12086] Tutorial doesn't discourage name mangling

2011-05-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: lukasz.langa -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue12086] Tutorial doesn't discourage name mangling

2011-05-16 Thread Łukasz Langa
Łukasz Langa added the comment: I'd like to see that section gone altogether. The tutorial is designed to be the first point of contact with the language. In that context name mangling is an obscure detail with an unlikely use case. If anything, the tutorial should simply state that private v

[issue12086] Tutorial doesn't discourage name mangling

2011-05-16 Thread Ezio Melotti
Ezio Melotti added the comment: I think the main problem here is that they are called "private" and people coming from other languages assume that the double underscore is the Python way to mark variables as private, whereas the appearance of being private is just a side effect of the name ma

[issue12086] Tutorial doesn't discourage name mangling

2011-05-16 Thread Radomir Dopieralski
Radomir Dopieralski added the comment: "In the unlikely case that you specifically need to avoid name clashes with subclasses, there is limited support..." ;) -- ___ Python tracker ___

[issue12086] Tutorial doesn't discourage name mangling

2011-05-16 Thread Tim Golden
Tim Golden added the comment: But at the least, the start of the para might be slightly reworded to something like: "If you specifically need to avoid name clashes with subclasses, there is limited support..." which avoids the phrase "Since there is a valid use-case for class-private members"

[issue12086] Tutorial doesn't discourage name mangling

2011-05-16 Thread Georg Brandl
Georg Brandl added the comment: No warnings, please. See http://docs.python.org/documenting/style.html#affirmative-tone and related sections. -- nosy: +georg.brandl ___ Python tracker __

[issue12086] Tutorial doesn't discourage name mangling

2011-05-16 Thread Łukasz Langa
Changes by Łukasz Langa : -- assignee: docs@python -> lukasz.langa nosy: +lukasz.langa stage: -> needs patch versions: +Python 3.1, Python 3.2, Python 3.3 ___ Python tracker ___

[issue12086] Tutorial doesn't discourage name mangling

2011-05-16 Thread Radomir Dopieralski
New submission from Radomir Dopieralski : In the tutorial, at http://docs.python.org/tutorial/classes.html#private-variables you can read: 9.6. Private Variables “Private” instance variables that cannot be accessed except from inside an object don’t exist in Python. However, there is a co