built-in function- module name clash
Olivier Vierlinck
Olivier.Vierlinck at iba.be
Mon Sep 6 06:02:18 EDT 2004
Hi,
I've a python script using somecalls to the abs() built-in function.
Now, I have to import a module named 'abs' too...
The consequence if that line code like
if (abs(a-b) < epsilon:
...
does not work anymore, with this error msg:
TypeError: 'module' object is not callable
Clearly, the interpreter tries first to consider 'abs' as a module name rather than a built-in function name.
Any idea on how to force it to call the abs() fct? Some kind of scoping or specific syntax?
(I could rename the abs module too but ...)
Thanks for your help,
cheers,
Olivier
More information about the Python-list
mailing list