[Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications)
Steven Bethard
steven.bethard at gmail.com
Mon Dec 12 22:33:39 CET 2005
On 12/12/05, Guido van Rossum <guido at python.org> wrote:
> On 12/11/05, Steven Bethard <steven.bethard at gmail.com> wrote:
> > class Document(_cdm.Document):
> > ...
> > # add convenience methods here
> > ...
>
> Personally, I find that naming convention a mistake. Call it
> MyDocument or EnhancedDocument or DocumentPlusPlus (be creative!) but
> don't reuse the original name.
>
> I'm not saying this because it helps the __private argument; I'm
> saying this because in lots of contexts we leave out the
> package/module path and only use the class name, and added
> functionality is a good reason to be able to distinguish between the
> original class and the enhanced version.
Ahh. I never run into this because I never import objects directly
from modules. So, instead of:
from elementtree.ElementTree import ElementTree
...
ElementTree(...)
I almost always write something like:
import elementtree.ElementTree as et
...
et.ElementTree(...)
Thus, all objects that were imported from external modules are always
immediately identifiable as such by their prefixed module name. I do
see though that if you like to import the objects directly from the
module this could be confusing.
STeVe
--
You can wordify anything if you just verb it.
--- Bucky Katt, Get Fuzzy
More information about the Python-Dev
mailing list