Lines Matching refs:Loader
245 self.__spec__.loader.exec_module(self)
266 class LazyLoader(abc.Loader):
268 """A loader that creates a module which defers loading until attribute access."""
271 def __check_eager_loader(loader):
272 if not hasattr(loader, 'exec_module'):
273 raise TypeError('loader must define exec_module()')
276 def factory(cls, loader):
277 """Construct a callable which returns the eager loader made lazy."""
278 cls.__check_eager_loader(loader)
279 return lambda *args, **kwargs: cls(loader(*args, **kwargs))
281 def __init__(self, loader):
282 self.__check_eager_loader(loader)
283 self.loader = loader
286 return self.loader.create_module(spec)
290 module.__spec__.loader = self.loader
291 module.__loader__ = self.loader
294 # e.g. ``module.__spec__.loader = None`` would trigger a load from