summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-05-01 13:59:34 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-05-01 13:59:34 +0300
commit59603a2e89d2b5cdfaafc68af2f55d4abeeacc86 (patch)
tree10bd887ab4f533414ed1aa720df0565a4b377bcb
parent4fb9452bff8c9e2665ea7c90d2485df8490b65d8 (diff)
downloadmicropython-59603a2e89d2b5cdfaafc68af2f55d4abeeacc86.tar.gz
micropython-59603a2e89d2b5cdfaafc68af2f55d4abeeacc86.zip
docs/sys: Describe sys.implementation.
-rw-r--r--docs/library/sys.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/library/sys.rst b/docs/library/sys.rst
index c060f1d9ef..197efc8015 100644
--- a/docs/library/sys.rst
+++ b/docs/library/sys.rst
@@ -34,6 +34,24 @@ Constants
The byte order of the system ("little" or "big").
+.. data:: implementation
+
+ Object with information about the current Python implementation. For
+ MicroPython, it has following attributes:
+
+ * `name` - string "micropython"
+ * `version` - tuple (major, minor, micro), e.g. (1, 7, 0)
+
+ This object is the recommended way to distinguish MicroPython from other
+ Python implementations (note that it still may not exist in the very
+ minimal ports).
+
+ .. admonition:: Difference to CPython
+ :class: attention
+
+ CPython mandates more attributes for this object, but the actual useful
+ bare minimum is implemented in MicroPython.
+
.. data:: modules
Dictionary of loaded modules. On some ports, it may not include builtin