Skip to content

Commit 13812a7

Browse files
authored
Merge pull request #4060 from dhalbert/regularize-extmod-modules
CIRCUITPY_* switches for JSON, RE, etc. Doc cleanup
2 parents 4241fd4 + f154ee8 commit 13812a7

File tree

23 files changed

+99
-524
lines changed

23 files changed

+99
-524
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Behavior
125125
get back into normal mode.
126126
- RGB status LED indicating CircuitPython state, and errors through a sequence of colored flashes.
127127
- Re-runs ``code.py`` or other main file after file system writes over USB mass storage. (Disable with
128-
``samd.disable_autoreload()``)
128+
``supervisor.disable_autoreload()``)
129129
- Entering the REPL after the main code is finished requires a key press which enters the REPL and
130130
disables autoreload.
131131
- Main is one of these: ``code.txt``, ``code.py``, ``main.py``,

docs/library/uerrno.rst renamed to docs/library/errno.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
:mod:`uerrno` -- system error codes
1+
:mod:`errno` -- system error codes
22
===================================
33

4-
.. include:: ../templates/unsupported_in_circuitpython.inc
5-
6-
.. module:: uerrno
4+
.. module:: errno
75
:synopsis: system error codes
86

97
|see_cpython_module| :mod:`cpython:errno`.
@@ -22,13 +20,13 @@ Constants
2220
try:
2321
os.mkdir("my_dir")
2422
except OSError as exc:
25-
if exc.args[0] == uerrno.EEXIST:
23+
if exc.args[0] == errno.EEXIST:
2624
print("Directory already exists")
2725

2826
.. data:: errorcode
2927

3028
Dictionary mapping numeric error codes to strings with symbolic error
3129
code (see above)::
3230

33-
>>> print(uerrno.errorcode[uerrno.EEXIST])
31+
>>> print(errno.errorcode[uerrno.EEXIST])
3432
EEXIST

docs/library/esp.rst

Lines changed: 0 additions & 85 deletions
This file was deleted.

docs/library/index.rst

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,21 @@ MicroPython libraries
66
Python standard libraries and micro-libraries
77
---------------------------------------------
88

9-
These libraries are inherited from MicroPython.
10-
They are similar to the standard Python libraries with the same name
11-
or with the "u" prefix dropped.
9+
The libraries below are inherited from MicroPython.
10+
They are similar to the standard Python libraries with the same name.
1211
They implement a subset of or a variant of the corresponding
1312
standard Python library.
1413

15-
.. warning::
16-
17-
Though these MicroPython-based libraries are available in CircuitPython,
18-
their functionality may change in the future, perhaps significantly.
19-
As CircuitPython continues to develop, new versions of these libraries will
20-
be created that are more compliant with the standard Python libraries.
21-
You may need to change your code later if you rely
22-
on any non-standard functionality they currently provide.
23-
2414
CircuitPython's long-term goal is that code written in CircuitPython
2515
using Python standard libraries will be runnable on CPython without changes.
2616

27-
Some libraries below are not enabled on CircuitPython builds with
17+
These libraries are not enabled on CircuitPython builds with
2818
limited flash memory, usually on non-Express builds:
29-
``uerrno``, ``ure``.
30-
31-
Some libraries are not currently enabled in any CircuitPython build, but may be in the future:
32-
``uio``, ``ujson``, ``uzlib``.
19+
``binascii``, ``errno``, ``json``, ``re``.
3320

34-
Some libraries are only enabled only WiFi-capable ports (ESP8266, nRF)
35-
because they are typically used for network software:
36-
``binascii``, ``hashlib``, ``uheapq``, ``uselect``, ``ussl``.
37-
Not all of these are enabled on all WiFi-capable ports.
21+
These libraries are not currently enabled in any CircuitPython build, but may be in the future,
22+
with the ``u`` prefix dropped:
23+
``uctypes``, ``uhashlib``, ``uzlib``.
3824

3925
.. toctree::
4026
:maxdepth: 1
@@ -44,13 +30,14 @@ Not all of these are enabled on all WiFi-capable ports.
4430
array.rst
4531
binascii.rst
4632
collections.rst
33+
errno.rst
4734
gc.rst
4835
hashlib.rst
36+
io.rst
37+
json.rst
38+
re.rst
4939
sys.rst
50-
uerrno.rst
51-
uio.rst
52-
ujson.rst
53-
ure.rst
40+
uctypes.rst
5441
uselect.rst
5542
usocket.rst
5643
ussl.rst
@@ -59,8 +46,8 @@ Not all of these are enabled on all WiFi-capable ports.
5946
Omitted functions in the ``string`` library
6047
-------------------------------------------
6148

62-
A few string operations are not enabled on CircuitPython
63-
M0 non-Express builds, due to limited flash memory:
49+
A few string operations are not enabled on small builds
50+
(usually non-Express), due to limited flash memory:
6451
``string.center()``, ``string.partition()``, ``string.splitlines()``,
6552
``string.reversed()``.
6653

@@ -78,15 +65,3 @@ versions of CircuitPython.
7865
btree.rst
7966
framebuf.rst
8067
micropython.rst
81-
network.rst
82-
uctypes.rst
83-
84-
Libraries specific to the ESP8266
85-
---------------------------------
86-
87-
The following libraries are specific to the ESP8266.
88-
89-
.. toctree::
90-
:maxdepth: 2
91-
92-
esp.rst

docs/library/uio.rst renamed to docs/library/io.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
:mod:`uio` -- input/output streams
1+
:mod:`io` -- input/output streams
22
==================================
33

4-
.. include:: ../templates/unsupported_in_circuitpython.inc
5-
6-
.. module:: uio
4+
.. module:: io
75
:synopsis: input/output streams
86

97
|see_cpython_module| :mod:`cpython:io`.

docs/library/ujson.rst renamed to docs/library/json.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
:mod:`ujson` -- JSON encoding and decoding
1+
:mod:`json` -- JSON encoding and decoding
22
==========================================
33

4-
.. include:: ../templates/unsupported_in_circuitpython.inc
5-
6-
.. module:: ujson
4+
.. module:: json
75
:synopsis: JSON encoding and decoding
86

97
|see_cpython_module| :mod:`cpython:json`.

0 commit comments

Comments
 (0)