summaryrefslogtreecommitdiff
path: root/docs/library/sys.rst
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2017-08-28 13:59:26 -0700
committerGitHub <noreply@github.com>2017-08-28 13:59:26 -0700
commit447a4b1ecd5655357c9daaace03b91355d2e2c6d (patch)
tree46ca08a93e9870aab4fbb533843f3c99796cbdf4 /docs/library/sys.rst
parent4e63d55d8d0df6d7600bb684fa90a8cb54708ba8 (diff)
parentc679c80c710fd4a0e37ad87200d8a721e19727aa (diff)
Merge pull request #208 from adafruit/merge-v1.9.2
Merge MicroPython v1.9.2
Diffstat (limited to 'docs/library/sys.rst')
-rw-r--r--docs/library/sys.rst24
1 files changed, 13 insertions, 11 deletions
diff --git a/docs/library/sys.rst b/docs/library/sys.rst
index 1d7579754..d49577306 100644
--- a/docs/library/sys.rst
+++ b/docs/library/sys.rst
@@ -4,19 +4,21 @@
.. module:: sys
:synopsis: system specific functions
+|see_cpython_module| :mod:`python:sys`.
+
Functions
---------
.. function:: exit(retval=0)
Terminate current program with a given exit code. Underlyingly, this
- function raise as ``SystemExit`` exception. If an argument is given, its
- value given as an argument to ``SystemExit``.
+ function raise as `SystemExit` exception. If an argument is given, its
+ value given as an argument to `SystemExit`.
.. function:: print_exception(exc, file=sys.stdout)
- Print exception with a traceback to a file-like object `file` (or
- ``sys.stdout`` by default).
+ Print exception with a traceback to a file-like object *file* (or
+ `sys.stdout` by default).
.. admonition:: Difference to CPython
:class: attention
@@ -24,9 +26,9 @@ Functions
This is simplified version of a function which appears in the
``traceback`` module in CPython. Unlike ``traceback.print_exception()``,
this function takes just exception value instead of exception type,
- exception value, and traceback object; `file` argument should be
+ exception value, and traceback object; *file* argument should be
positional; further arguments are not supported. CPython-compatible
- ``traceback`` module can be found in micropython-lib.
+ ``traceback`` module can be found in `micropython-lib`.
Constants
---------
@@ -37,15 +39,15 @@ Constants
.. data:: byteorder
- The byte order of the system ("little" or "big").
+ 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)
+ * *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
@@ -95,10 +97,10 @@ Constants
The platform that MicroPython is running on. For OS/RTOS ports, this is
usually an identifier of the OS, e.g. ``"linux"``. For baremetal ports it
- is an identifier of a board, e.g. "pyboard" for the original MicroPython
+ is an identifier of a board, e.g. ``"pyboard"`` for the original MicroPython
reference board. It thus can be used to distinguish one board from another.
If you need to check whether your program runs on MicroPython (vs other
- Python implementation), use ``sys.implementation`` instead.
+ Python implementation), use `sys.implementation` instead.
.. data:: stderr