Pass Variable On Import

后端 未结 8 1417
轻奢々
轻奢々 2020-12-16 09:37

Let\'s say you have some time-consuming work to do when a module/class is first imported. This functionality is dependent on a passed in variable. It only needs to be done

8条回答
  •  被撕碎了的回忆
    2020-12-16 10:13

    Could you benefit from a Proxy which implements lazy loading?

    Check out the Active State "Lazy Module Imports" recipe.

提交回复
热议问题