Skip to content

Commit 59615fc

Browse files
committed
add caveat language re MicroPython libraries; other slight changes
1 parent e65cc07 commit 59615fc

File tree

6 files changed

+40
-20
lines changed

6 files changed

+40
-20
lines changed

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ CircuitPython:
108108
- supports only SAMD21, SAMD51, and ESP8266 ports. An nRF port is under
109109
development.
110110
- tracks MicroPython's releases (not master).
111-
- Longints (arbitrary-length integers) are turned on for most Express builds
112-
(those boards with SPI flash chips external to the microcontroller),
113-
but not for boards without SPI flash, for space reasons.
111+
- Longints (arbitrary-length integers) are enabled for most M0
112+
Express boards (those boards with SPI flash chips external
113+
to the microcontroller), and for all M4 builds.
114+
Longints are disabled on other boards due to lack of flash space.
114115

115116
Behavior
116117
~~~~~~~~

docs/library/gc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
:mod:`gc` -- control the garbage collector
22
==========================================
33

4+
.. include:: ../templates/unsupported_in_circuitpython.inc
5+
46
.. module:: gc
57
:synopsis: control the garbage collector
68

docs/library/index.rst

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
.. _micropython_lib:
22

3-
CircuitPython libraries
3+
MicroPython libraries
44
=====================
55

66
Python standard libraries and micro-libraries
77
---------------------------------------------
88

9-
These libraries are the same or are subsets or slight variants of the standard Python libraries.
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.
12+
They implement a subset of or a variant of the corresponding
13+
standard Python library.
1014

11-
MicroPython prefixed many of these libraries with ``u``. In CircuitPython, those
12-
that are subsets or the same as the standard Python libraries have been or will be renamed
13-
to their original names.
14-
Our aspiration is that code written in CircuitPython
15-
that uses Python standard libraries will be runnable on CPython without changes.
16-
But we may fall short of this goal in some cases.
15+
.. warning::
1716

18-
Some of the libraries below are not enabled on CircuitPython builds with
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+
24+
CircuitPython's goal long-term goalis that code written in CircuitPython
25+
using Python standard libraries will be runnable on CPython without changes.
26+
27+
Some libraries below are not enabled on CircuitPython builds with
1928
limited flash memory, usually on non-Express builds:
2029
``uerrno``, ``ure``.
2130

@@ -51,17 +60,18 @@ Not all of these are enabled on all WiFi-capable ports.
5160
Omitted functions in the ``string`` library
5261
-------------------------------------------
5362

54-
A few string operations are not enabled on CircuitPython builds with
55-
limited flash memory, usually on non-Express builds:
63+
A few string operations are not enabled on CircuitPython
64+
M0 non-Express builds, due to limited flash memory:
5665
``string.center()``, ``string.partition()``, ``string.splitlines()``,
5766
``string.reversed()``.
5867

5968

6069
CircuitPython/MicroPython-specific libraries
6170
------------------------------
6271

63-
Functionality specific to the CircuitPython (MicroPython) implementation is available in
64-
the following libraries.
72+
Functionality specific to the CircuitPython/MicroPython implementation is available in
73+
the following libraries. These libraries may change signficantly or be removed in future
74+
versions of CircuitPtyon.
6575

6676
.. toctree::
6777
:maxdepth: 1

docs/library/struct.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
:mod:`struct` -- pack and unpack primitive data types
22
======================================================
33

4+
.. include:: ../templates/unsupported_in_circuitpython.inc
5+
46
.. module:: struct
57
:synopsis: pack and unpack primitive data types
68

docs/library/sys.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
:mod:`sys` -- system specific functions
22
=======================================
33

4+
.. include:: ../templates/unsupported_in_circuitpython.inc
5+
46
.. module:: sys
57
:synopsis: system specific functions
68

@@ -98,7 +100,7 @@ Constants
98100
usually an identifier of the OS, e.g. ``"linux"``. For baremetal ports it
99101
is an identifier of the chip on a board, e.g. ``"MicroChip SAMD51"``.
100102
It thus can be used to distinguish one board from another.
101-
If you need to check whether your program runs on MicroPython (vs other
103+
If you need to check whether your program runs on CircuitPython (vs other
102104
Python implementation), use `sys.implementation` instead.
103105

104106
.. data:: stderr
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.. warning::
22

3-
This module is inherited from MicroPython and may not work in CircuitPython
4-
as documented or at all! If they do work, they may change at any time. It is
5-
unsupported.
3+
Though this MicroPython-based library is available for use in CircuitPython,
4+
its functionality may change in the future, perhaps significantly.
5+
As CircuitPython continues to develop, it may be changed
6+
to comply more closely with the corresponding standard Python library.
7+
You may need to change your code later if you rely
8+
on any non-standard functionality it currently provides.

0 commit comments

Comments
 (0)