<br><br><div class="gmail_quote">On Thu, Mar 22, 2012 at 4:26 PM, Maru Newby <span dir="ltr"><<a href="mailto:mnewby@internap.com">mnewby@internap.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi Jay,<div><div class="im"><br><div><div>On 2012-03-22, at 2:13 PM, Jay Pipes wrote:</div><blockquote type="cite"><div><font color="#000000"><br></font>Object Imports<br>==============<br>
<br>In addition, the following DOES NOT appear in Glance's section on imports:<br><br>- Do not import objects, only modules<br><br>Nowhere in PEP8 does it mention anything about not importing objects. In fact, PEP8 </div>
</blockquote></div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im"><div><blockquote type="cite">
<div>says this:<br></div></blockquote></div></div></div></div></blockquote><div><br></div><div>The rule is there because it makes it obvious where you are using objects from (and they aren't in the current namespace), prevents that "where is this defined -scan around the file- oh, it is being imported from this other thing, let's go look there" pattern, instead you see very obviously that it isn't defined in the file and usually has a unique enough name already that you know exactly where to look.</div>
<div><br></div><div>It is something pulled from the google style guide.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im">
<div><blockquote type="cite"><div></div></blockquote></div><br></div><div>I'm pretty sure the reason for this rule has nothing to do with PEP8, and is instead intended to avoid circular imports.  I don't see the utility in applying the rule to 3rd party modules, since circular imports wouldn't be an issue, but I do consider it a best practice for project code.</div>
<div><br></div><div>Cheers,</div><div><br></div><div><br></div><div>Maru</div></div></div><br>_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br></blockquote></div><br>