On Jul 15, 10:08 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Sun, 15 Jul 2007 08:49:54 -0300, Alex Popescu
> <[EMAIL PROTECTED]> escribió:
>
>
>
> >> > But, I still don't understand how python can access a function in a
> >> > file I have NOT included. In this case, to get things to w
En Sun, 15 Jul 2007 08:49:54 -0300, Alex Popescu
<[EMAIL PROTECTED]> escribió:
>> > But, I still don't understand how python can access a function in a
>> > file I have NOT included. In this case, to get things to work, I DO
>> > NOT "import MMA.grooves" but later in the module I access a functi
On Jul 14, 6:27 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Fri, 13 Jul 2007 13:24:57 -0300, bvdp <[EMAIL PROTECTED]> escribió:
>
>
>
>
>
> >> Seehttp://effbot.org/zone/import-confusion.htm
> >> Try to move the circular references later in the code (maybe inside a
> >> function, when it
En Sat, 14 Jul 2007 14:44:05 -0300, bvdp <[EMAIL PROTECTED]> escribió:
>> > But, I still don't understand how python can access a function in a
>> > file I have NOT included. In this case, to get things to work, I DO
>> > NOT "import MMA.grooves" but later in the module I access a function
>> > wi
bvdp wrote:
> before I moved other
> imports around I was able to do the following:
>
> 1. NOT include MMA.gooves,
> 2. call the function MMA.grooves.somefunc()
>
> and have it work.
The import doesn't necessarily have to be in the same module
where the attribute is used. The first time *any*
> > But, I still don't understand how python can access a function in a
> > file I have NOT included. In this case, to get things to work, I DO
> > NOT "import MMA.grooves" but later in the module I access a function
> > with "xx=MMA.grooves.somefunc()" and it finds the function, and works
> > jus
En Fri, 13 Jul 2007 13:24:57 -0300, bvdp <[EMAIL PROTECTED]> escribió:
>
>> Seehttp://effbot.org/zone/import-confusion.htm
>> Try to move the circular references later in the code (maybe inside a
>> function, when it is required), or much better, refactor it so there is
>> no
>> circularity.
>>
Just as a bit of a followup, I have fixed the problem in my code. I
changed the order of some of the imports in some other modules.
What I was doing was more guesswork and good luck ... but it works. I
really wonder if there is a better way to figure these problems out.
Reading a few of the other
> Seehttp://effbot.org/zone/import-confusion.htm
> Try to move the circular references later in the code (maybe inside a
> function, when it is required), or much better, refactor it so there is no
> circularity.
>
> --
> Gabriel Genellina
Yes, thanks. I'd read that page before posting. Helpful.
En Thu, 12 Jul 2007 23:36:16 -0300, bvdp <[EMAIL PROTECTED]> escribió:
> I'm going quite nutty here with an import problem. I've got a fairly
> complicated program (about 12,000 lines in 34 modules). I just made
> some "improvements" and get the following error:
>
> bob$ mma
> Traceback (most rece
"Learning Python" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> An example in the book I didn't understood well
> two modules files recursively import/from each other
There are past postings available in the archives (via Google) at least,
that lucided discuss circular imports.
11 matches
Mail list logo