[openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302
Chris Behrens
cbehrens at codestud.com
Thu Apr 10 03:24:07 UTC 2014
On Apr 9, 2014, at 12:50 PM, Dan Smith <dms at danplanet.com> wrote:
>>> So I'm a soft -1 on dropping it from hacking.
>
> Me too.
>
>> from testtools import matchers
>> ...
>>
>> Or = matchers.Or
>> LessThan = matchers.LessThan
>> ...
>
> This is the right way to do it, IMHO, if you have something like
> matchers.Or that needs to be treated like part of the syntax. Otherwise,
> module-only imports massively improves the ability to find where
> something comes from.
+1
My eyes bleed when I open up a python script and find 1 million imports for individual functions and classes.
- Chris
More information about the OpenStack-dev
mailing list