Naming conflict with Python standard library module
An excellent part of Python is that it provides a wealth of library modules. But the result of this is that if you do not subconsciously avoid it, it is easy for you to encounter a situation where the name of your own module conflicts with the name of a standard library that comes with Python (for example, your code may have a name called email.py module, it will conflict with the module of the same name in the standard library).
This can cause some very rough problems. For example, when you want to load a library, the library needs to load a module in the Python standard library. As a result, because you have a module with the same name as the module in the standard library, this package You loaded your module by mistake instead of loading the module in the Python standard library. This will cause trouble.
So be careful when naming modules and avoid duplicating the names of modules in the Python standard library. Compared to submitting a "Python Enhancement Proposal (PEP)" to request to change the name of a package in the standard library and get approval, it is easier for you to change the name of your own module many.
Knowledge point expansion:
Introduction to the Python Standard Library
text
Binary data
type of data
This is the end of this article about Python novices learning standard library module naming. For more detailed explanations on the naming of Python standard library modules, please search ZaLou.Cn
Recommended Posts