Why is there a rule in PEP: don't use «from module import *»? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Why is there a rule in PEP: don't use «from module import *»?

Told me pls: WHY?

12th Aug 2021, 6:15 AM
Григорий Коротенко
Григорий Коротенко - avatar
2 Réponses
+ 4
The problem is that different modules can use the same names for stuff. If you just import everything from modules this will lead to naming conflicts that can seriously screw things up.
12th Aug 2021, 6:22 AM
Simon Sauter
Simon Sauter - avatar
+ 1
Thanks
12th Aug 2021, 6:23 AM
Григорий Коротенко
Григорий Коротенко - avatar