Best practice for lazy loading Python modules

后端 未结 4 1380
孤城傲影
孤城傲影 2021-02-03 19:09

Occasionally I want lazy module loading in Python. Usually because I want to keep runtime requirements or start-up times low and splitting the code into sub-modules would be cum

4条回答
  •  长情又很酷
    2021-02-03 19:36

    The other answers have covered the actual details but if you are interested in a lazy loading library, check out apipkg which is part of the py package (py.test fame).

提交回复
热议问题