Roundup Robot devnull@devnull 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
Roundup Robot devnull@devnull 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
Raymond Hettinger raymond.hettin...@gmail.com 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
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12086
___
___
Python-bugs-list
Radomir Dopieralski python-b...@sheep.art.pl 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
Ezio Melotti ezio.melo...@gmail.com 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
New submission from Radomir Dopieralski python-b...@sheep.art.pl:
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
Changes by Łukasz Langa luk...@langa.pl:
--
assignee: docs@python - lukasz.langa
nosy: +lukasz.langa
stage: - needs patch
versions: +Python 3.1, Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12086
Georg Brandl ge...@python.org added the comment:
No warnings, please. See
http://docs.python.org/documenting/style.html#affirmative-tone and related
sections.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
Tim Golden m...@timgolden.me.uk 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
Radomir Dopieralski python-b...@sheep.art.pl added the comment:
In the unlikely case that you specifically need to avoid name clashes with
subclasses, there is limited support... ;)
--
___
Python tracker rep...@bugs.python.org
Ezio Melotti ezio.melo...@gmail.com 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
Łukasz Langa luk...@langa.pl 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
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: lukasz.langa - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12086
___
Raymond Hettinger raymond.hettin...@gmail.com 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
15 matches
Mail list logo