Skip to content

Commit c737cde

Browse files
jimmodpgeorge
authored andcommitted
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 <jim.mussared@gmail.com>
1 parent 2186063 commit c737cde

42 files changed

Lines changed: 175 additions & 175 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/develop/library.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ An example is the ``gc`` module discussed in :ref:`memorymanagement`.
3434
>>> gc.enable()
3535
>>>
3636
37-
MicroPython has several other builtin standard/core modules like ``io``, ``uarray`` etc.
37+
MicroPython has several other builtin standard/core modules like ``io``, ``array`` etc.
3838
Adding a new core module involves several modifications.
3939

4040
First, create the ``C`` file in the ``py/`` directory. In this example we are adding a

docs/develop/porting.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ That should give a MicroPython REPL. You can then run commands like:
245245
.. code-block:: bash
246246
247247
MicroPython v1.13 on 2021-01-01; example-board with unknown-cpu
248-
>>> import usys
249-
>>> usys.implementation
248+
>>> import sys
249+
>>> sys.implementation
250250
('micropython', (1, 13, 0))
251251
>>>
252252

docs/esp32/quickref.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ A useful function for connecting to your local WiFi network is::
9898
pass
9999
print('network config:', wlan.ifconfig())
100100

101-
Once the network is established the :mod:`socket <usocket>` module can be used
101+
Once the network is established the :mod:`socket <socket>` module can be used
102102
to create and use TCP/UDP sockets as usual, and the ``urequests`` module for
103103
convenient HTTP requests.
104104

@@ -113,7 +113,7 @@ to reconnect forever).
113113
Delay and timing
114114
----------------
115115

116-
Use the :mod:`time <utime>` module::
116+
Use the :mod:`time <time>` module::
117117

118118
import time
119119

@@ -459,15 +459,15 @@ SD card
459459

460460
See :ref:`machine.SDCard <machine.SDCard>`. ::
461461

462-
import machine, uos
462+
import machine, os
463463

464464
# Slot 2 uses pins sck=18, cs=5, miso=19, mosi=23
465465
sd = machine.SDCard(slot=2)
466-
uos.mount(sd, "/sd") # mount
466+
os.mount(sd, "/sd") # mount
467467

468-
uos.listdir('/sd') # list directory contents
468+
os.listdir('/sd') # list directory contents
469469

470-
uos.umount('/sd') # eject
470+
os.umount('/sd') # eject
471471

472472
RMT
473473
---

docs/esp8266/general.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Real-time clock
117117

118118
RTC in ESP8266 has very bad accuracy, drift may be seconds per minute. As
119119
a workaround, to measure short enough intervals you can use
120-
``utime.time()``, etc. functions, and for wall clock time, synchronize from
120+
``time.time()``, etc. functions, and for wall clock time, synchronize from
121121
the net using included ``ntptime.py`` module.
122122

123123
Due to limitations of the ESP8266 chip the internal real-time clock (RTC)
@@ -203,7 +203,7 @@ limitation with usage of TLS on the low-memory devices:
203203
communication with other devices.
204204

205205
There are also some not implemented features specifically in MicroPython's
206-
``ussl`` module based on axTLS:
206+
``ssl`` module based on axTLS:
207207

208208
6. Certificates are not validated (this makes connections susceptible
209209
to man-in-the-middle attacks).

docs/esp8266/quickref.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ A useful function for connecting to your local WiFi network is::
7878
pass
7979
print('network config:', wlan.ifconfig())
8080

81-
Once the network is established the :mod:`socket <usocket>` module can be used
81+
Once the network is established the :mod:`socket <socket>` module can be used
8282
to create and use TCP/UDP sockets as usual.
8383

8484
Delay and timing
8585
----------------
8686

87-
Use the :mod:`time <utime>` module::
87+
Use the :mod:`time <time>` module::
8888

8989
import time
9090

@@ -171,15 +171,15 @@ attaches the REPL).
171171

172172
To detach the REPL from UART0, use::
173173

174-
import uos
175-
uos.dupterm(None, 1)
174+
import os
175+
os.dupterm(None, 1)
176176

177177
The REPL is attached by default. If you have detached it, to reattach
178178
it use::
179179

180-
import uos, machine
180+
import os, machine
181181
uart = machine.UART(0, 115200)
182-
uos.dupterm(uart, 1)
182+
os.dupterm(uart, 1)
183183

184184
PWM (pulse width modulation)
185185
----------------------------

docs/library/array.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
:mod:`uarray` -- arrays of numeric data
2-
=======================================
1+
:mod:`array` -- arrays of numeric data
2+
======================================
33

4-
.. module:: uarray
4+
.. module:: array
55
:synopsis: efficient arrays of numeric data
66

77
|see_cpython_module| :mod:`python:array`.

docs/library/binascii.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
:mod:`ubinascii` -- binary/ASCII conversions
2-
============================================
1+
:mod:`binascii` -- binary/ASCII conversions
2+
===========================================
33

4-
.. module:: ubinascii
4+
.. module:: binascii
55
:synopsis: binary/ASCII conversions
66

77
|see_cpython_module| :mod:`python:binascii`.

docs/library/bluetooth.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
:mod:`ubluetooth` --- low-level Bluetooth
2-
=========================================
1+
:mod:`bluetooth` --- low-level Bluetooth
2+
========================================
33

4-
.. module:: ubluetooth
4+
.. module:: bluetooth
55
:synopsis: Low-level Bluetooth radio functionality
66

77
This module provides an interface to a Bluetooth controller on a board.
@@ -110,7 +110,7 @@ Event Handling
110110

111111
**Note:** As an optimisation to prevent unnecessary allocations, the ``addr``,
112112
``adv_data``, ``char_data``, ``notify_data``, and ``uuid`` entries in the
113-
tuples are read-only memoryview instances pointing to ubluetooth's internal
113+
tuples are read-only memoryview instances pointing to :mod:`bluetooth`'s internal
114114
ringbuffer, and are only valid during the invocation of the IRQ handler
115115
function. If your program needs to save one of these values to access after
116116
the IRQ handler has returned (e.g. by saving it in a class instance or global
@@ -293,7 +293,7 @@ For the ``_IRQ_PASSKEY_ACTION`` event, the available actions are::
293293
_PASSKEY_ACTION_NUMERIC_COMPARISON = const(4)
294294

295295
In order to save space in the firmware, these constants are not included on the
296-
:mod:`ubluetooth` module. Add the ones that you need from the list above to your
296+
:mod:`bluetooth` module. Add the ones that you need from the list above to your
297297
program.
298298

299299

docs/library/btree.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Example::
2222

2323
# First, we need to open a stream which holds a database
2424
# This is usually a file, but can be in-memory database
25-
# using uio.BytesIO, a raw flash partition, etc.
25+
# using io.BytesIO, a raw flash partition, etc.
2626
# Oftentimes, you want to create a database file if it doesn't
2727
# exist and open if it exists. Idiom below takes care of this.
2828
# DO NOT open database with "a+b" access mode.

docs/library/collections.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
:mod:`ucollections` -- collection and container types
2-
=====================================================
1+
:mod:`collections` -- collection and container types
2+
====================================================
33

4-
.. module:: ucollections
4+
.. module:: collections
55
:synopsis: collection and container types
66

77
|see_cpython_module| :mod:`python:collections`.
@@ -49,7 +49,7 @@ Classes
4949
a string with space-separated field named (but this is less efficient).
5050
Example of use::
5151

52-
from ucollections import namedtuple
52+
from collections import namedtuple
5353

5454
MyTuple = namedtuple("MyTuple", ("id", "name"))
5555
t1 = MyTuple(1, "foo")
@@ -63,7 +63,7 @@ Classes
6363
added. When ordered dict is iterated over, keys/items are returned in
6464
the order they were added::
6565

66-
from ucollections import OrderedDict
66+
from collections import OrderedDict
6767

6868
# To make benefit of ordered keys, OrderedDict should be initialized
6969
# from sequence of (key, value) pairs.

0 commit comments

Comments
 (0)