我写了一个模块,它作为一个配置文件:
users = list(
dict(
username="x",
password="y"
)
)
但是,当我检查列表的导入内容时,它包含字典的键,而不是字典条目:
>>> import user as userdata
import user as userdata
>>> userdata.users
userdata.users
['username', 'password']
>>>