Question on importing and function defs

Nick Miller nickmiller92 at gmail.com
Sun Mar 2 11:25:04 EST 2008


TC wrote:
> I have a problem.  Here's a simplified version of what I'm doing:
>
> I have functions a() and b() in a module called 'mod'.  b() calls a().
>
> So now, I have this program:
>
> from mod import *
>
> def a():
>     blahblah
>
> b()
>
>
> The problem being, b() is calling the a() that's in mod, not the new
> a() that I want to replace it.  (Both a()'s have identical function
> headers, in case that matters.)  How can I fix this?
>
> Thanks for any help.
>   

The only problem I could see with this is a local function issue. 
Meaning that even when you write the new a() function in the main source 
file, b() doesn't know it exists because it's relying on it's own 
"local" a() in the module. I'm also new to using Python so I that's all 
I can think would be the problem.

Nick




More information about the Python-list mailing list