(self, name, impmask)
Create a virtual package that redirects imports (see PEP 302).
Create a virtual package that redirects imports (see PEP 302).
Create a virtual package that redirects imports ( see PEP 302 ) .
def __init__(self, name, impmask):
        ''' Create a virtual package that redirects imports (see PEP 302). '''
        self.name = name
        self.impmask = impmask
        self.module = sys.modules.setdefault(name, imp.new_module(name))
        self.module.__dict__.update({'__file__': __file__, '__path__': [],
                                    '__all__': [], '__loader__': self})
        sys.meta_path.append(self)
def __init__ ( self , name , impmask ) : self . name = name self . impmask = impmask self . module = sys . modules . setdefault ( name , imp . new_module ( name ) ) self . module . __dict__ . update ( { '__file__' : __file__ , '__path__' : [ ] , '__all__' : [ ] , '__loader__' : self } ) sys . meta_path . append ( self )