class fake_module(object):

    def __init__(self, name, *args):
        self.name = name
self.__all__ = []
all_objects = globals()
for name in args:
    self.__dict__[name] = all_objects[name]
self.__all__.append(name)

def register(self):
    sys.modules['%s.%s' % (__name__, self.name)] = self
fake_module('api', 'class1', 'class2', 'func3', 'exception4').register()
Как определить API `from ... import *' отдельно от __all__ в модуле?