I have a code that looks like this:
from pyparsing import Word, alphas, Optional, ...
parser = ...
I like to be able to call from <package> import <etc>, but I want it to be used only in a very small code segment. I am afraid that I am contributing to the pollution of the namespace because I have some small fragments like this in the same file.
What is the pythonic way to handle this situation? I still just play with it, so I would rather not write and rewrite pyparsing.so many times.
source
share