gpt4 book ai didi

python - 为什么不允许在函数中使用 "from ... import *"?

转载 作者:太空宇宙 更新时间:2023-11-03 12:59:22 24 4
gpt4 key购买 nike

<分区>

来自 the documentation :

The wild card form of import — from module import * — is only allowed at the module level. Attempting to use it in class or function definitions will raise a SyntaxError.

为什么?避免在函数中使用它有什么意义?有什么问题?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com