On 09/30/2009 04:20 PM, Seth Vidal wrote:
On Wed, 30 Sep 2009, Tim Lauridsen wrote:
from constants import *
import metalink
Why ?
from yum.i18n import ....
is more readable than
from i18n import .....
and it is easier to see what is a yum submodule.
That's a fair point - major concern I've ever had is importing the wrong
module if you're working in a separate working path.
maybe that's not a real concern but it was at one point for me and I got
into that habit.
You do make a good point about figuring out what is from the yum module
and what is not, though..
I'll think about it.
Another point is Python 3, where local dir imports are changed[1] so.
import constants (Python 2.x)
will be
from . import constants (Python 3.x)
but
import yum.constants
with work in both 2.x and 3.x
Tim
[1] : http://diveintopython3.org/porting-code-to-python-3-with-2to3.html#import
_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel