Suppose I have a package with an __init__.py like this:
# ifpy init script
import ifpy.world as world
import ifpy.grammar as grammar
import ifpy.util as util
import ifpy.cli as cli
__all__ = [*world.__all__, *grammar.__all__, *util.__all__, *cli.__all__]
from ifpy.world import *
from ifpy.grammar import *
from ifpy.util import *
from ifpy.cli import *
I'm making it specifically like this because it's supposed to be a public library and safe for import *
. It works just fine when I use it in code, from ifpy import *
and all the classes work without needing the ifpy.Class
namespace (although you can also just do that as well) but mypy is telling me that those classes don't exist. Anyone else run into this problem? If you have, can you fix it and how?
EDIT: Note that if I from ifpy.world import *
it works and mypy recognizes the import and type-checks accordingly.