[Import-sig] Re: [Python-Dev] Proposal for a modified import mechanism.

Prabhu Ramachandran Prabhu Ramachandran <prabhu@cyberwaveindia.com>
Mon, 12 Nov 2001 21:12:05 +0530


>>>>> "GMcM" == Gordon McMillan <gmcm@hypernet.com> writes:

    GMcM> Prabhu wrote:
    >> Okay, so what do you propose?  What do you think is the best
    >> solution?? import, rimport, rrimport??

    GMcM> If I had access to Guido's time machine, I would probably
    GMcM> change things so: import is "absolute import" rimport is
    GMcM> "relative import" rrimport is "recursive relative import"

Is borrowing the time machine an option? <wink>

    GMcM> I don't, so I tend towards: aimport is "absolute import"
    GMcM> rimport is "relative import" rrimport is "recursive relative
    GMcM> import" and import is try: rimport except ImportError:
    GMcM> aimport

It sounds good but I dont see the point with introducing rimport and
rrimport.  Afterall, import is going to do rimport so maybe all we
need is:

import - "same old"
aimport - "absolute import"
rimport - "recursive relative import"

    GMcM> My rather unreliable crystal ball tells me the number one
    GMcM> objection to this will be "Why should I have to spell it out
    GMcM> - I just want to import it". My reply to that would be the
    GMcM> same as my reply to those who don't want to be bothered by
    GMcM> having to choose a spelling for division: at the time you
    GMcM> write the code, you know exactly what you want. When your
    GMcM> code runs, we can only guess what you wanted.

Makes sense.

prabhu