mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
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".
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user