xiuminglib icon indicating copy to clipboard operation
xiuminglib copied to clipboard

Imports are not lazy enough

Open xiumingzhang opened this issue 6 years ago • 1 comments

Consider moving any non-basic imports into the functions.

This is not inefficient because imports are cached, and more importantly, helps reduce import failures.

If an import is pretty much necessary for all functions in the module (like import bpy to blender.object), wrap the import inside try, so it won't fail at init time (deferring failure till the use time).

xiumingzhang avatar Jun 13 '19 23:06 xiumingzhang

I reiterate: If an import is pretty much necessary for all functions in the module (like import bpy to blender.object), wrap the import inside try, so it won't fail at init time (deferring failure till the use time).

xiumingzhang avatar Jul 12 '19 21:07 xiumingzhang