From c737cde9472741337be0c0a66e8e99695c6a9b14 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Thu, 12 Aug 2021 13:59:29 +1000 Subject: [PATCH] docs: Replace ufoo with foo in all docs. Anywhere a module is mentioned, use its "non-u" name for consistency. The "import module" vs "import umodule" is something of a FAQ, and this commit intends to help clear that up. As a first approximation MicroPython is Python, and so imports should work the same as Python and use the same name, to a first approximation. The u-version of a module is a detail that can be learned later on, when the user wants to understand more and have finer control over importing. Existing Python code should just work, as much as it is possible to do that within the constraints of embedded systems, and the MicroPython documentation should match the idiomatic way to write Python code. With universal weak links for modules (via MICROPY_MODULE_WEAK_LINKS) users can consistently use "import foo" across all ports (with the exception of the minimal ports). And the ability to override/extend via "foo.py" continues to work well. Signed-off-by: Jim Mussared --- docs/develop/library.rst | 2 +- docs/develop/porting.rst | 4 +-- docs/esp32/quickref.rst | 12 ++++---- docs/esp8266/general.rst | 4 +-- docs/esp8266/quickref.rst | 12 ++++---- docs/library/array.rst | 6 ++-- docs/library/binascii.rst | 6 ++-- docs/library/bluetooth.rst | 10 +++---- docs/library/btree.rst | 2 +- docs/library/collections.rst | 10 +++---- docs/library/cryptolib.rst | 12 ++++---- docs/library/errno.rst | 12 ++++---- docs/library/esp32.rst | 2 +- docs/library/hashlib.rst | 14 +++++----- docs/library/heapq.rst | 6 ++-- docs/library/index.rst | 4 +-- docs/library/io.rst | 6 ++-- docs/library/json.rst | 6 ++-- docs/library/machine.SDCard.rst | 4 +-- docs/library/network.WLAN.rst | 2 +- docs/library/network.rst | 10 +++---- docs/library/os.rst | 14 +++++----- docs/library/pyb.Flash.rst | 2 +- docs/library/pyb.rst | 4 +-- docs/library/re.rst | 14 +++++----- docs/library/rp2.Flash.rst | 2 +- docs/library/select.rst | 18 ++++++------ docs/library/socket.rst | 48 ++++++++++++++++---------------- docs/library/ssl.rst | 20 ++++++------- docs/library/struct.rst | 6 ++-- docs/library/sys.rst | 14 +++++----- docs/library/time.rst | 10 +++---- docs/library/uctypes.rst | 2 +- docs/library/zlib.rst | 6 ++-- docs/pyboard/quickref.rst | 2 +- docs/reference/constrained.rst | 6 ++-- docs/reference/filesystem.rst | 12 ++++---- docs/reference/glossary.rst | 2 +- docs/reference/speed_python.rst | 6 ++-- docs/rp2/quickref.rst | 2 +- docs/wipy/general.rst | 8 +++--- docs/zephyr/tutorial/storage.rst | 6 ++-- 42 files changed, 175 insertions(+), 175 deletions(-) diff --git a/docs/develop/library.rst b/docs/develop/library.rst index bebddcc8a3..47ea2dc8d2 100644 --- a/docs/develop/library.rst +++ b/docs/develop/library.rst @@ -34,7 +34,7 @@ An example is the ``gc`` module discussed in :ref:`memorymanagement`. >>> gc.enable() >>> -MicroPython has several other builtin standard/core modules like ``io``, ``uarray`` etc. +MicroPython has several other builtin standard/core modules like ``io``, ``array`` etc. Adding a new core module involves several modifications. First, create the ``C`` file in the ``py/`` directory. In this example we are adding a diff --git a/docs/develop/porting.rst b/docs/develop/porting.rst index 08f3557f18..549227d762 100644 --- a/docs/develop/porting.rst +++ b/docs/develop/porting.rst @@ -245,8 +245,8 @@ That should give a MicroPython REPL. You can then run commands like: .. code-block:: bash MicroPython v1.13 on 2021-01-01; example-board with unknown-cpu - >>> import usys - >>> usys.implementation + >>> import sys + >>> sys.implementation ('micropython', (1, 13, 0)) >>> diff --git a/docs/esp32/quickref.rst b/docs/esp32/quickref.rst index 56c3721148..3153ebd571 100644 --- a/docs/esp32/quickref.rst +++ b/docs/esp32/quickref.rst @@ -98,7 +98,7 @@ A useful function for connecting to your local WiFi network is:: pass print('network config:', wlan.ifconfig()) -Once the network is established the :mod:`socket ` module can be used +Once the network is established the :mod:`socket ` module can be used to create and use TCP/UDP sockets as usual, and the ``urequests`` module for convenient HTTP requests. @@ -113,7 +113,7 @@ to reconnect forever). Delay and timing ---------------- -Use the :mod:`time ` module:: +Use the :mod:`time