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

View File

@ -21,6 +21,8 @@ Functions and types
.. class:: bytes()
|see_cpython| `python:bytes`.
.. function:: callable()
.. function:: chr()
@ -174,6 +176,10 @@ Exceptions
.. 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:: StopIteration
@ -182,8 +188,12 @@ Exceptions
.. exception:: SystemExit
|see_cpython| `python:SystemExit`.
.. exception:: TypeError
|see_cpython| `python:TypeError`.
.. exception:: ValueError
.. exception:: ZeroDivisionError

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,6 +4,8 @@
.. module:: uselect
: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
streams (select streams which are ready for operations).

View File

@ -5,10 +5,9 @@
.. module:: usocket
: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>`_
for comparison.
This module provides access to the BSD socket interface.
.. admonition:: Difference to CPython
:class: attention

View File

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

View File

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

View File

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

View File

@ -4,6 +4,8 @@
.. module:: uzlib
:synopsis: zlib decompression
|see_cpython_module| :mod:`python:zlib`.
This modules allows to decompress binary data compressed with DEFLATE
algorithm (commonly used in zlib library and gzip archiver). Compression
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:*