Project
__init__.py
main.py
parser.py
From within main, how do I import my my parser module given that parser is already a built-in?
Current, renaming the user-defined module is the worst-case solution.
I've tried:
import parser
from parser import TextFileParser
from parser import TextFileParser
from . import parser
from .parser import TextFileParser
from __future__ import absolute_import
from . import parser as myParser
as well as a few other combinations.
I've read the answer to this related question, but my understanding is that 3.5 uses absolute imports by default. I also read this article, but it didn't seem to apply.
I'm also happy aliasing the class I need, if that is possible. i.e.
TextParseClass = from parser import TextParser