mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Merge pull request #1288 from DaKnOb/fixpymod
[python/en] Add note about Python Module Order of Import
This commit is contained in:
commit
2c94436824
@ -657,6 +657,12 @@ math.sqrt == m.sqrt == sqrt # => True
|
|||||||
import math
|
import math
|
||||||
dir(math)
|
dir(math)
|
||||||
|
|
||||||
|
# If you have a Python script named math.py in the same
|
||||||
|
# folder as your current script, the file math.py will
|
||||||
|
# be loaded instead of the built-in Python module.
|
||||||
|
# This happens because the local folder has priority
|
||||||
|
# over Python's built-in libraries.
|
||||||
|
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
## 7. Advanced
|
## 7. Advanced
|
||||||
|
@ -716,6 +716,11 @@ math.sqrt(16) == m.sqrt(16) # => True
|
|||||||
import math
|
import math
|
||||||
dir(math)
|
dir(math)
|
||||||
|
|
||||||
|
# If you have a Python script named math.py in the same
|
||||||
|
# folder as your current script, the file math.py will
|
||||||
|
# be loaded instead of the built-in Python module.
|
||||||
|
# This happens because the local folder has priority
|
||||||
|
# over Python's built-in libraries.
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
## 7. Advanced
|
## 7. Advanced
|
||||||
|
Loading…
Reference in New Issue
Block a user