mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 06:46:17 +00:00
Use "local" instead of "global" to describe where imports go
This commit is contained in:
@@ -441,8 +441,8 @@ bad practice. **Using** ``import *`` **makes code harder to read and makes
|
|||||||
dependencies less compartmentalized**.
|
dependencies less compartmentalized**.
|
||||||
|
|
||||||
Using ``from modu import func`` is a way to pinpoint the function you want to
|
Using ``from modu import func`` is a way to pinpoint the function you want to
|
||||||
import and put it in the global namespace. While much less harmful than ``import
|
import and put it in the local namespace. While much less harmful than ``import
|
||||||
*`` because it shows explicitly what is imported in the global namespace, its
|
*`` because it shows explicitly what is imported in the local namespace, its
|
||||||
only advantage over a simpler ``import modu`` is that it will save a little
|
only advantage over a simpler ``import modu`` is that it will save a little
|
||||||
typing.
|
typing.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user