[openstack-dev] H302 considered harmful

melanie witt melwittt at gmail.com
Wed Feb 25 19:54:48 UTC 2015


On Feb 25, 2015, at 10:51, Duncan Thomas <duncan.thomas at gmail.com> wrote:

> Is there anybody who'd like to step forward in defence of this rule and explain why it is an improvement? I don't discount for a moment the possibility I'm missing something, and welcome the education in that case

A reason I can think of would be to preserve namespacing (no possibility of function or class name collision upon import). Another reason could be maintainability, scenario being: Person 1 imports ClassA from a module to use, Person 2 comes along later and needs a different class from the module so they import ClassB from the same module to use, and it continues. If only the module had been imported, everybody can just do module.ClassA, module.ClassB instead of potentially multiple imports from the same module of different classes and functions. I've also read it doesn't cost more to import the entire module rather than just a function or a class, as the whole module has to be parsed either way.

melanie (melwitt)




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150225/5fe4c3a8/attachment.pgp>


More information about the OpenStack-dev mailing list