Module Conflicts

Ivan Illarionov ivan.illarionov at
Thu Apr 10 22:31:08 CEST 2008

On Apr 10, 2:33 am, Jose <jfgome... at> wrote:
> I have a module named in a package with some class
> definitions.  I am trying to import the standard python math module
> inside of but It seems to be importing itself.  Is there any
> way around this problem without renaming my 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.


More information about the Python-list mailing list