diff options
author | stijn <stijn@ignitron.net> | 2020-06-18 11:19:14 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-09-04 00:10:24 +1000 |
commit | 40ad8f1666b265dafc7844d765f45cfae4b6299f (patch) | |
tree | d073a4b4f791f53d1a73c47d029bf2b49f041d5e /docs/library | |
parent | b0932fcf2e2f9a81abf7737ed4b2573bd9ad4a49 (diff) |
all: Rename "sys" module to "usys".
This is consistent with the other 'micro' modules and allows implementing
additional features in Python via e.g. micropython-lib's sys.
Note this is a breaking change (not backwards compatible) for ports which
do not enable weak links, as "import sys" must now be replaced with
"import usys".
Diffstat (limited to 'docs/library')
-rw-r--r-- | docs/library/index.rst | 2 | ||||
-rw-r--r-- | docs/library/usys.rst (renamed from docs/library/sys.rst) | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/docs/library/index.rst b/docs/library/index.rst index 952e67d43..43d9e87f3 100644 --- a/docs/library/index.rst +++ b/docs/library/index.rst @@ -77,7 +77,6 @@ it will fallback to loading the built-in ``ujson`` module. cmath.rst gc.rst math.rst - sys.rst uarray.rst uasyncio.rst ubinascii.rst @@ -93,6 +92,7 @@ it will fallback to loading the built-in ``ujson`` module. usocket.rst ussl.rst ustruct.rst + usys.rst utime.rst uzlib.rst _thread.rst diff --git a/docs/library/sys.rst b/docs/library/usys.rst index 24f9e353b..960164385 100644 --- a/docs/library/sys.rst +++ b/docs/library/usys.rst @@ -1,7 +1,7 @@ -:mod:`sys` -- system specific functions -======================================= +:mod:`usys` -- system specific functions +======================================== -.. module:: sys +.. module:: usys :synopsis: system specific functions |see_cpython_module| :mod:`python:sys`. @@ -28,10 +28,10 @@ Functions This function is a MicroPython extension intended to provide similar functionality to the :mod:`atexit` module in CPython. -.. function:: print_exception(exc, file=sys.stdout, /) +.. function:: print_exception(exc, file=usys.stdout, /) Print exception with a traceback to a file-like object *file* (or - `sys.stdout` by default). + `usys.stdout` by default). .. admonition:: Difference to CPython :class: attention @@ -84,7 +84,7 @@ Constants value directly, but instead count number of bits in it:: bits = 0 - v = sys.maxsize + v = usys.maxsize while v: bits += 1 v >>= 1 @@ -113,7 +113,7 @@ Constants 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 `usys.implementation` instead. .. data:: stderr |