Hi all,
I've run into some behavior from Python 2.6.1 that I didn't expect. Here is some trivial code to reproduce the problem:
---- ControlPointValue.py ------
class ControlPointValue:
def __init__(self):
pass
---- ControlPointValueSet.py ----
import ControlPointValue
---- main.py --------------------
from ControlPointValue import *
from ControlPointValueSet import *
val = ControlPointValue()
.... here is the error I get when I run main.py (under OS/X Snow Leopard, if it matters):
jeremy-friesners-mac-pro-3:~ jaf$ python main.py
Traceback (most recent call last):
File "main.py", line 4, in <module>
val = ControlPointValue()
TypeError: 'module' object is not callable
Can someone explain what is going on here? Is Python getting confused because the class name is the same as the file name? If so, what is the best way to fix the problem? (I'd prefer to have my python files named after the classes that are defined in them)
Thanks, Jeremy