Merge pull request #83 from alexlnkp/pr-optimization

fixes for all operating systems + lazyimporting
This commit is contained in:
kalomaze
2023-08-01 18:59:34 -05:00
committed by GitHub
2 changed files with 1044 additions and 1035 deletions

13
LazyImport.py Normal file
View File

@@ -0,0 +1,13 @@
from importlib.util import find_spec, LazyLoader, module_from_spec
from sys import modules
def lazyload(name):
if name in modules:
return modules[name]
else:
spec = find_spec(name)
loader = LazyLoader(spec.loader)
module = module_from_spec(spec)
modules[name] = module
loader.exec_module(module)
return module

File diff suppressed because it is too large Load Diff