Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2014-04-09 Thread Duncan Thomas
I totally agree with Sean. If you're going to weaken the rule in a codeable way (e.g. it doesn't apply to tests, or to certain named modules or whatever), then great, fix up the HACKING tool and make the code slightly more readable. But the general advantages of having the check outway the

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2014-04-09 Thread Duncan Thomas
On 6 August 2013 21:18, Christopher Armstrong chris.armstr...@rackspace.com wrote: I think it's really unfortunate that people will block patches based on stylistic concerns. The answer, IMO, is to codify in policy that stylistic issues *cannot* block a patch from landing. It think the

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2014-04-09 Thread Dan Smith
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,

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2014-04-09 Thread Chris Behrens
On Apr 9, 2014, at 12:50 PM, Dan Smith d...@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

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2013-08-06 Thread Mate Lakat
Hi, What about saying that you are not restricted to use H302 in test code test_*.py ? On Mon, Aug 05, 2013 at 08:03:26PM -0700, Clint Byrum wrote: Excerpts from Robert Collins's message of 2013-08-05 19:26:20 -0700: I wanted to get a temperature reading from everyone on this style guideline.

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2013-08-06 Thread Sean Dague
On 08/05/2013 10:38 PM, Monty Taylor wrote: On 08/05/2013 11:26 PM, Robert Collins wrote: I wanted to get a temperature reading from everyone on this style guideline. My view on it is that it's a useful heuristic but shouldn't be a golden rule applied everywhere. Things like matches are

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2013-08-06 Thread Alex Meade
: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302 On 08/05/2013 10:38 PM, Monty Taylor wrote: On 08/05/2013 11:26 PM, Robert Collins wrote: I wanted to get a temperature reading from everyone on this style guideline. My view on it is that it's a useful

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2013-08-06 Thread Morgan Fainberg
While I'm torn on this as a developer, it comes down to an ease of understanding the code. In all cases, it is easier to understand where something comes from if you only import modules. Enforcing the import of modules tends to also ensure namespace conflicts don't occur as often. When it comes

[openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2013-08-05 Thread Robert Collins
I wanted to get a temperature reading from everyone on this style guideline. My view on it is that it's a useful heuristic but shouldn't be a golden rule applied everywhere. Things like matches are designed to be used as a dsl: self.assertThat(foo, Or(Equals(1), Equals(2))) rather than what

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2013-08-05 Thread Alex Gaynor
I'd favor weakening or removing this requirement. Besides google I've never seen any other python project which enforced this standard, and I think it's a very weak heuristic for readability. Alex On Mon, Aug 5, 2013 at 7:26 PM, Robert Collins robe...@robertcollins.netwrote: I wanted to get a

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2013-08-05 Thread Monty Taylor
On 08/05/2013 11:26 PM, Robert Collins wrote: I wanted to get a temperature reading from everyone on this style guideline. My view on it is that it's a useful heuristic but shouldn't be a golden rule applied everywhere. Things like matches are designed to be used as a dsl:

Re: [openstack-dev] Dropping or weakening the 'only import modules' style guideline - H302

2013-08-05 Thread Clint Byrum
Excerpts from Robert Collins's message of 2013-08-05 19:26:20 -0700: I wanted to get a temperature reading from everyone on this style guideline. My view on it is that it's a useful heuristic but shouldn't be a golden rule applied everywhere. Things like matches are designed to be used as a