[New-bugs-announce] [issue12086] Tutorial doesn't discourage name mangling

Radomir Dopieralski report at bugs.python.org
Mon May 16 10:35:44 CEST 2011

New submission from Radomir Dopieralski <python-bugs at sheep.art.pl>:

In the tutorial, at http://docs.python.org/tutorial/classes.html#private-variables you can read:

9.6. Private Variables




I think that this section doesn't stress enough how special the "__foo" syntax is and how rarely it should be used. If I was a programmer coming from Java to Python, I would start using "__foo" everywhere after reading this. I actually receive code written like that from programmers new to Python, and they point to that section of documentation when I ask why they did it.

At minimum, I'd add a paragraph that warns about how name mangling makes the code hard to reuse, difficult to test and unpleasant to debug.

assignee: docs at python
components: Documentation
messages: 136072
nosy: docs at python, sheep
priority: normal
severity: normal
status: open
title: Tutorial doesn't discourage name mangling
type: feature request
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list