[MERGE] init remote branches
John Arbash Meinel
john at arbash-meinel.com
Sun Jul 2 22:39:31 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
> Wouter van Heyst wrote:
>>> - transport = get_transport(location)
>>> + transport = bzrlib.transport.get_transport(location)
>
> One style nitpick: I think it's nicer to importexceeding 80 chars, or
> particular names than to import the whole package. I prefer
> get_transport to bzrlib.transport.get_transport.
>
> - It's much shorter, so we don't wind up having to contort our code to
> avoid exceeding 80 chars.
> - It declares what we're using at the top, which can be useful to know.
> (For example, if someone removed get_transport from bzrlib.transport,
> we'd get an ImportError from importing builtins, instead of when we ran
> init.)
>
> Aaron
I prefer the opposite. If only because it makes demandload work much better.
Demandloading a function is a risky proposition, demandloading a module
works pretty well.
I'm okay with the style of:
from bzrlib import errors, transport, etc
t = transport.get_transport()
But I would like to see us get away from importing every function up at
the top. (And if I do some demandload stuff, I'll probably be doing some
of that very cleanup.)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEqD0TJdeBCYSNAAMRAtzhAJ9tA3LQoX5tag34Vh2EKYlIJAv78wCgm4NE
47osN/rerJBQSpTyc7wS/yA=
=022U
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list