summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorven <vendethiel@hotmail.fr>2016-03-10 23:00:50 +0100
committerven <vendethiel@hotmail.fr>2016-03-10 23:00:50 +0100
commit2c944368244deedff40874133ac05b8470a389f4 (patch)
tree9ce99122d803d48b06cc317a5c37a3b3b235d409
parent7540270a00fcacd94c9bd5ca683cd2031e8328cf (diff)
parent879337f9be2ef3c6ea2b01d34d2a21ad325c6cc4 (diff)
Merge pull request #1288 from DaKnOb/fixpymod
[python/en] Add note about Python Module Order of Import
-rw-r--r--python.html.markdown6
-rw-r--r--python3.html.markdown5
2 files changed, 11 insertions, 0 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 2e7fd8be..12be4be1 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -657,6 +657,12 @@ math.sqrt == m.sqrt == sqrt # => True
import 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
diff --git a/python3.html.markdown b/python3.html.markdown
index d88ccec1..ea29fdba 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -716,6 +716,11 @@ math.sqrt(16) == m.sqrt(16) # => True
import 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