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/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4