Why is “import *” bad?

后端 未结 12 2257
北恋
北恋 2020-11-21 06:26

It is recommended to not to use import * in Python.

Can anyone please share the reason for that, so that I can avoid it doing next time?

12条回答
  •  太阳男子
    2020-11-21 06:52

    http://docs.python.org/tutorial/modules.html

    Note that in general the practice of importing * from a module or package is frowned upon, since it often causes poorly readable code.

提交回复
热议问题