docs/library: Add CPython docs xref to each pertinent module.

Cross-reference text/link is implemented as RST substitution, so easy to
consistently.
This commit is contained in:
Paul Sokolovsky 2017-07-02 15:37:31 +03:00
parent ebce7984c6
commit 465d84b7e7
21 changed files with 53 additions and 8 deletions

View File

@ -4,8 +4,7 @@
.. module:: array .. module:: array
:synopsis: efficient arrays of numeric data :synopsis: efficient arrays of numeric data
See `Python array <https://docs.python.org/3/library/array.html>`_ for more |see_cpython_module| :mod:`python:array`.
information.
Supported format codes: ``b``, ``B``, ``h``, ``H``, ``i``, ``I``, ``l``, Supported format codes: ``b``, ``B``, ``h``, ``H``, ``i``, ``I``, ``l``,
``L``, ``q``, ``Q``, ``f``, ``d`` (the latter 2 depending on the ``L``, ``q``, ``Q``, ``f``, ``d`` (the latter 2 depending on the

View File

@ -21,6 +21,8 @@ Functions and types
.. class:: bytes() .. class:: bytes()
|see_cpython| `python:bytes`.
.. function:: callable() .. function:: callable()
.. function:: chr() .. function:: chr()
@ -174,6 +176,10 @@ Exceptions
.. exception:: OSError .. exception:: OSError
|see_cpython| `python:OSError`. MicroPython doesn't implement ``errno``
attribute, instead use the standard way to access exception arguments:
``exc.args[0]``.
.. exception:: RuntimeError .. exception:: RuntimeError
.. exception:: StopIteration .. exception:: StopIteration
@ -182,8 +188,12 @@ Exceptions
.. exception:: SystemExit .. exception:: SystemExit
|see_cpython| `python:SystemExit`.
.. exception:: TypeError .. exception:: TypeError
|see_cpython| `python:TypeError`.
.. exception:: ValueError .. exception:: ValueError
.. exception:: ZeroDivisionError .. exception:: ZeroDivisionError

View File

@ -4,6 +4,8 @@
.. module:: cmath .. module:: cmath
:synopsis: mathematical functions for complex numbers :synopsis: mathematical functions for complex numbers
|see_cpython_module| :mod:`python:cmath`.
The ``cmath`` module provides some basic mathematical functions for The ``cmath`` module provides some basic mathematical functions for
working with complex numbers. working with complex numbers.

View File

@ -4,6 +4,8 @@
.. module:: gc .. module:: gc
:synopsis: control the garbage collector :synopsis: control the garbage collector
|see_cpython_module| :mod:`python:gc`.
Functions Functions
--------- ---------

View File

@ -4,6 +4,8 @@
.. module:: math .. module:: math
:synopsis: mathematical functions :synopsis: mathematical functions
|see_cpython_module| :mod:`python:math`.
The ``math`` module provides some basic mathematical functions for The ``math`` module provides some basic mathematical functions for
working with floating-point numbers. working with floating-point numbers.

View File

@ -4,6 +4,8 @@
.. module:: sys .. module:: sys
:synopsis: system specific functions :synopsis: system specific functions
|see_cpython_module| :mod:`python:sys`.
Functions Functions
--------- ---------

View File

@ -4,6 +4,8 @@
.. module:: ubinascii .. module:: ubinascii
:synopsis: binary/ASCII conversions :synopsis: binary/ASCII conversions
|see_cpython_module| :mod:`python:binascii`.
This module implements conversions between binary data and various This module implements conversions between binary data and various
encodings of it in ASCII form (in both directions). encodings of it in ASCII form (in both directions).

View File

@ -4,6 +4,8 @@
.. module:: ucollections .. module:: ucollections
:synopsis: collection and container types :synopsis: collection and container types
|see_cpython_module| :mod:`python:collections`.
This module implements advanced collection and container types to This module implements advanced collection and container types to
hold/accumulate various objects. hold/accumulate various objects.

View File

@ -4,6 +4,8 @@
.. module:: uhashlib .. module:: uhashlib
:synopsis: hashing algorithms :synopsis: hashing algorithms
|see_cpython_module| :mod:`python:hashlib`.
This module implements binary data hashing algorithms. The exact inventory This module implements binary data hashing algorithms. The exact inventory
of available algorithms depends on a board. Among the algorithms which may of available algorithms depends on a board. Among the algorithms which may
be implemented: be implemented:

View File

@ -4,6 +4,8 @@
.. module:: uheapq .. module:: uheapq
:synopsis: heap queue algorithm :synopsis: heap queue algorithm
|see_cpython_module| :mod:`python:heapq`.
This module implements the heap queue algorithm. This module implements the heap queue algorithm.
A heap queue is simply a list that has its elements stored in a certain way. A heap queue is simply a list that has its elements stored in a certain way.

View File

@ -4,6 +4,8 @@
.. module:: uio .. module:: uio
:synopsis: input/output streams :synopsis: input/output streams
|see_cpython_module| :mod:`python:io`.
This module contains additional types of stream (file-like) objects This module contains additional types of stream (file-like) objects
and helper functions. and helper functions.

View File

@ -4,6 +4,8 @@
.. module:: ujson .. module:: ujson
:synopsis: JSON encoding and decoding :synopsis: JSON encoding and decoding
|see_cpython_module| :mod:`python:json`.
This modules allows to convert between Python objects and the JSON This modules allows to convert between Python objects and the JSON
data format. data format.

View File

@ -4,6 +4,8 @@
.. module:: uos .. module:: uos
:synopsis: basic "operating system" services :synopsis: basic "operating system" services
|see_cpython_module| :mod:`python:os`.
The ``uos`` module contains functions for filesystem access and ``urandom`` The ``uos`` module contains functions for filesystem access and ``urandom``
function. function.

View File

@ -4,6 +4,8 @@
.. module:: ure .. module:: ure
:synopsis: regular expressions :synopsis: regular expressions
|see_cpython_module| :mod:`python:re`.
This module implements regular expression operations. Regular expression This module implements regular expression operations. Regular expression
syntax supported is a subset of CPython ``re`` module (and actually is syntax supported is a subset of CPython ``re`` module (and actually is
a subset of POSIX extended regular expressions). a subset of POSIX extended regular expressions).

View File

@ -4,6 +4,8 @@
.. module:: uselect .. module:: uselect
:synopsis: wait for events on a set of streams :synopsis: wait for events on a set of streams
|see_cpython_module| :mod:`python:select`.
This module provides functions to efficiently wait for events on multiple This module provides functions to efficiently wait for events on multiple
streams (select streams which are ready for operations). streams (select streams which are ready for operations).

View File

@ -5,10 +5,9 @@
.. module:: usocket .. module:: usocket
:synopsis: socket module :synopsis: socket module
This module provides access to the BSD socket interface. |see_cpython_module| :mod:`python:socket`.
See the corresponding `CPython module <https://docs.python.org/3/library/socket.html>`_ This module provides access to the BSD socket interface.
for comparison.
.. admonition:: Difference to CPython .. admonition:: Difference to CPython
:class: attention :class: attention

View File

@ -4,6 +4,8 @@
.. module:: ussl .. module:: ussl
:synopsis: TLS/SSL wrapper for socket objects :synopsis: TLS/SSL wrapper for socket objects
|see_cpython_module| :mod:`python:ssl`.
This module provides access to Transport Layer Security (previously and This module provides access to Transport Layer Security (previously and
widely known as “Secure Sockets Layer”) encryption and peer authentication widely known as “Secure Sockets Layer”) encryption and peer authentication
facilities for network sockets, both client-side and server-side. facilities for network sockets, both client-side and server-side.

View File

@ -4,8 +4,7 @@
.. module:: ustruct .. module:: ustruct
:synopsis: pack and unpack primitive data types :synopsis: pack and unpack primitive data types
See `Python struct <https://docs.python.org/3/library/struct.html>`_ for more |see_cpython_module| :mod:`python:struct`.
information.
Supported size/byte order prefixes: ``@``, ``<``, ``>``, ``!``. Supported size/byte order prefixes: ``@``, ``<``, ``>``, ``!``.

View File

@ -4,6 +4,8 @@
.. module:: utime .. module:: utime
:synopsis: time related functions :synopsis: time related functions
|see_cpython_module| :mod:`python:time`.
The ``utime`` module provides functions for getting the current time and date, The ``utime`` module provides functions for getting the current time and date,
measuring time intervals, and for delays. measuring time intervals, and for delays.

View File

@ -4,6 +4,8 @@
.. module:: uzlib .. module:: uzlib
:synopsis: zlib decompression :synopsis: zlib decompression
|see_cpython_module| :mod:`python:zlib`.
This modules allows to decompress binary data compressed with DEFLATE This modules allows to decompress binary data compressed with DEFLATE
algorithm (commonly used in zlib library and gzip archiver). Compression algorithm (commonly used in zlib library and gzip archiver). Compression
is not yet implemented. is not yet implemented.

View File

@ -1 +1,7 @@
.. # This file is intended for global "replace" definitions. .. comment: This file is intended for global "replace" definitions.
.. |see_cpython_module| replace::
*This module implements a subset of the corresponding* `CPython` *module,
as described below. For more information, refer to the original
CPython documentation:*