Scope question

MDK mdk at
Thu Feb 7 10:26:02 EST 2002

I have this:


from mymod import *

def dosomething(x):

# End code

I want the dosomething(1000) run from the function in mymod.  However,
instead it is running dosomething(x) in

Note: Changing the names of dosomething() in either module is not an option.
(The names depicted here are not the real names in the program but have been
changed for clarity.)

I know that one way to fix this is to change

from mymod import *


import mymod

But I would like to know if, without changing the import line, there is a
way to tell Python to use the dosomething() from mymod.

I tried mymod.dosomething(1000) but it returns an error:
AttributeError: 'builtin_function_or_method' object has no attribute


More information about the Python-list mailing list