[Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications) (original) (raw)
Guido van Rossum guido at python.org
Mon Dec 12 20:19:34 CET 2005
- Previous message: [Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications)
- Next message: [Python-Dev] PEP 8 updates/clarifications
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/12/05, Scott David Daniels <Scott.Daniels at acm.org> wrote:
Perhaps "The _ name convention is designed for 'mixins'; as a means of enforcing "private" it is both ineffective and annoying. For example, distutils.msvccompiler uses a bunch of instance variables which would I would like to access in a subclass, but are "unavailable" because the author could not imagine why I would need them.
But __private's use case is not restricted to mixins; this seems to be a common misconception. It is a tool (not the only one!) for name conflict avoidance in all inheritance situations, including single inheritance.
BTW let me note that inheritance is overused. People should get used to containment patterns (e.g. facade, delegate etc.) in favor of inheritance patterns.
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications)
- Next message: [Python-Dev] PEP 8 updates/clarifications
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]