Re: Newbie question about import

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luca

    Re: Newbie question about import

    On Sat, Apr 26, 2008 at 4:14 AM, Gabriel Genellina
    <gagsl-py2@yahoo.com.a rwrote:
    The short answer is: don't do that! __init__.py may import any module, but
    other modules in the package should not import anything from __init__.py
    The same rule applies to the main module in an application: it can import
    any other required module, but no one should import main.
    If you don't follow those rules you may encounter some surprises.
    You *can* break the rules and actually do what you want, but I would not
    reccomend it.
    In this case, can't you switch the place where __version__ is defined? It
    looks like a constant, so you could have it actually defined in mommy.py,
    and inside __init__.py just import the value.
    >
    Ok, thanks all for helping.

    --
    -- luca
Working...