2
我有一個函數load_config
加載和返回一個Python模塊:Mypy「類模塊」註釋
import imp
def load_config(path: str):
return imp.load_source('config', path)
print(type(load_config('config.py')))
這個片斷輸出<class 'module'>
。如何註釋load_config
與Mypy的返回值?