On Apr 11, 12:31 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On Apr 10, 2:33 am, Jose <[EMAIL PROTECTED]> wrote: > > > I have a module named math.py in a package with some class > > definitions. I am trying to import the standard python math module > > inside of math.py but It seems to be importing itself. Is there any > > way around this problem without renaming my math.py file? > > Yes, if you are using Python 2.5 > > from __future__ import absolute import > > after this `import math` will always import standard math module and > `from . import math` will import your module. > > -- > Ivan
I should say `from __future__ import absolute_import` And it's relatively easy to do in earlier versions too: create subdirectory `stdmath` with one `__init__.py` file with one line `import math` and than use `from stdmath import math`. and than use -- http://mail.python.org/mailman/listinfo/python-list