[Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications)
François Pinard
pinard at iro.umontreal.ca
Thu Dec 15 02:00:58 CET 2005
[Steven Bethard]
>import ellogon.utils as utils
>import ellogon.features.relations as features_relations
>import ellogon.chunking as chunking
>import ml.classifiers as _ml_classifiers
>import ml.data as _ml_data
>The only two-letter one was ElementTree, and the vast majority were
>unabbreviated, though as you can see, some of them drop one of the
>items in the import chain. Do you find imports like the above
>problematic?
No, all of the above seems very clear. What creates us problems is the
flurry of two-letter abbreviations for imported modules.
>FWIW, I don't like importing objects from modules directly for the
>same reason that when I write Java now, I always use an explicit
>"this" for instance variables. When I see a name which isn't local to
>a function, I want to have some idea where it came from...
Reasonable, and clearer. Yet, in some cases, the reuse of a few
prefixes all over the code may develop being more polluting than
helping. Good taste may be better than too inflexible principles. One
may search the source with an editor and quickly find the proper import.
_Given_, of course, it is not of the form "from HELL import *". :-)
But this gets a bit far from the original topic. Let's drop the matter
here as not being much more of general interest, or else, let's switch
to private email.
Keep happy, all.
--
François Pinard http://pinard.progiciels-bpi.ca
More information about the Python-Dev
mailing list