Commit 2d6097d0 authored by Cheryl Sabella's avatar Cheryl Sabella Committed by Victor Stinner

bpo-11233: Create availability directive for documentation (GH-9692)

Replace "Availability: xxx" with ".. availability:: xxx" in the doc.
Original patch by Georg Brandl.
Co-Authored-By: default avatarGeorg Brandl <georg@python.org>
parent da2bf9f6
...@@ -186,34 +186,42 @@ NULL pointer for use in a ``return`` statement. ...@@ -186,34 +186,42 @@ NULL pointer for use in a ``return`` statement.
then it constructs a tuple object whose first item is the *ierr* value and whose then it constructs a tuple object whose first item is the *ierr* value and whose
second item is the corresponding error message (gotten from second item is the corresponding error message (gotten from
:c:func:`FormatMessage`), and then calls ``PyErr_SetObject(PyExc_WindowsError, :c:func:`FormatMessage`), and then calls ``PyErr_SetObject(PyExc_WindowsError,
object)``. This function always returns *NULL*. Availability: Windows. object)``. This function always returns *NULL*.
.. availability:: Windows.
.. c:function:: PyObject* PyErr_SetExcFromWindowsErr(PyObject *type, int ierr) .. c:function:: PyObject* PyErr_SetExcFromWindowsErr(PyObject *type, int ierr)
Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter
specifying the exception type to be raised. Availability: Windows. specifying the exception type to be raised.
.. availability:: Windows.
.. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename) .. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename)
Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the
filename is given as a C string. *filename* is decoded from the filesystem filename is given as a C string. *filename* is decoded from the filesystem
encoding (:func:`os.fsdecode`). Availability: Windows. encoding (:func:`os.fsdecode`).
.. availability:: Windows.
.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObject(PyObject *type, int ierr, PyObject *filename) .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObject(PyObject *type, int ierr, PyObject *filename)
Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an
additional parameter specifying the exception type to be raised. additional parameter specifying the exception type to be raised.
Availability: Windows.
.. availability:: Windows.
.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObjects(PyObject *type, int ierr, PyObject *filename, PyObject *filename2) .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObjects(PyObject *type, int ierr, PyObject *filename, PyObject *filename2)
Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`,
but accepts a second filename object. but accepts a second filename object.
Availability: Windows.
.. availability:: Windows.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -221,7 +229,9 @@ NULL pointer for use in a ``return`` statement. ...@@ -221,7 +229,9 @@ NULL pointer for use in a ``return`` statement.
.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, const char *filename) .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, const char *filename)
Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional
parameter specifying the exception type to be raised. Availability: Windows. parameter specifying the exception type to be raised.
.. availability:: Windows.
.. c:function:: PyObject* PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path) .. c:function:: PyObject* PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path)
......
...@@ -156,7 +156,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. ...@@ -156,7 +156,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
See :pep:`529` for more details. See :pep:`529` for more details.
Availability: Windows. .. availability:: Windows.
.. c:var:: Py_LegacyWindowsStdioFlag .. c:var:: Py_LegacyWindowsStdioFlag
...@@ -168,7 +168,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. ...@@ -168,7 +168,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
See :pep:`528` for more details. See :pep:`528` for more details.
Availability: Windows. .. availability:: Windows.
.. c:var:: Py_NoSiteFlag .. c:var:: Py_NoSiteFlag
......
...@@ -101,7 +101,8 @@ This module defines the following constants and functions: ...@@ -101,7 +101,8 @@ This module defines the following constants and functions:
memory page size - platform documentation should be referred to for more memory page size - platform documentation should be referred to for more
information (4 KiB pages are common; using multiples of 4096 for the stack size is information (4 KiB pages are common; using multiples of 4096 for the stack size is
the suggested approach in the absence of more specific information). the suggested approach in the absence of more specific information).
Availability: Windows, systems with POSIX threads.
.. availability:: Windows, systems with POSIX threads.
.. data:: TIMEOUT_MAX .. data:: TIMEOUT_MAX
......
...@@ -510,7 +510,7 @@ Opening network connections ...@@ -510,7 +510,7 @@ Opening network connections
See the documentation of the :meth:`loop.create_connection` method See the documentation of the :meth:`loop.create_connection` method
for information about arguments to this method. for information about arguments to this method.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -630,7 +630,7 @@ Creating network servers ...@@ -630,7 +630,7 @@ Creating network servers
See the documentation of the :meth:`loop.create_server` method See the documentation of the :meth:`loop.create_server` method
for information about arguments to this method. for information about arguments to this method.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -979,7 +979,7 @@ Unix signals ...@@ -979,7 +979,7 @@ Unix signals
Return ``True`` if the signal handler was removed, or ``False`` if Return ``True`` if the signal handler was removed, or ``False`` if
no handler was set for the given signal. no handler was set for the given signal.
Availability: Unix. .. availability:: Unix.
.. seealso:: .. seealso::
...@@ -1423,14 +1423,14 @@ on all platforms. ...@@ -1423,14 +1423,14 @@ on all platforms.
asyncio.set_event_loop(loop) asyncio.set_event_loop(loop)
Availability: Unix, Windows. .. availability:: Unix, Windows.
.. class:: ProactorEventLoop .. class:: ProactorEventLoop
An event loop for Windows that uses "I/O Completion Ports" (IOCP). An event loop for Windows that uses "I/O Completion Ports" (IOCP).
Availability: Windows. .. availability:: Windows.
.. seealso:: .. seealso::
......
...@@ -107,7 +107,7 @@ asyncio ships with the following built-in policies: ...@@ -107,7 +107,7 @@ asyncio ships with the following built-in policies:
An alternative event loop policy that uses the An alternative event loop policy that uses the
:class:`SelectorEventLoop` event loop implementation. :class:`SelectorEventLoop` event loop implementation.
Availability: Windows. .. availability:: Windows.
.. class:: WindowsProactorEventLoopPolicy .. class:: WindowsProactorEventLoopPolicy
...@@ -115,7 +115,7 @@ asyncio ships with the following built-in policies: ...@@ -115,7 +115,7 @@ asyncio ships with the following built-in policies:
An alternative event loop policy that uses the An alternative event loop policy that uses the
:class:`ProactorEventLoop` event loop implementation. :class:`ProactorEventLoop` event loop implementation.
Availability: Windows. .. availability:: Windows.
Process Watchers Process Watchers
......
...@@ -114,7 +114,7 @@ and work with streams: ...@@ -114,7 +114,7 @@ and work with streams:
See also the documentation of :meth:`loop.create_unix_connection`. See also the documentation of :meth:`loop.create_unix_connection`.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -136,7 +136,7 @@ and work with streams: ...@@ -136,7 +136,7 @@ and work with streams:
See also the documentation of :meth:`loop.create_unix_server`. See also the documentation of :meth:`loop.create_unix_server`.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.7 .. versionadded:: 3.7
......
...@@ -273,14 +273,18 @@ any that have been added to the map during asynchronous service) is closed. ...@@ -273,14 +273,18 @@ any that have been added to the map during asynchronous service) is closed.
with an optional map argument and wraps it for use with the :c:func:`poll` with an optional map argument and wraps it for use with the :c:func:`poll`
or :c:func:`loop` functions. If provided a file object or anything with a or :c:func:`loop` functions. If provided a file object or anything with a
:c:func:`fileno` method, that method will be called and passed to the :c:func:`fileno` method, that method will be called and passed to the
:class:`file_wrapper` constructor. Availability: UNIX. :class:`file_wrapper` constructor.
.. availability:: Unix.
.. class:: file_wrapper() .. class:: file_wrapper()
A file_wrapper takes an integer file descriptor and calls :func:`os.dup` to A file_wrapper takes an integer file descriptor and calls :func:`os.dup` to
duplicate the handle so that the original handle may be closed independently duplicate the handle so that the original handle may be closed independently
of the file_wrapper. This class implements sufficient methods to emulate a of the file_wrapper. This class implements sufficient methods to emulate a
socket for use by the :class:`file_dispatcher` class. Availability: UNIX. socket for use by the :class:`file_dispatcher` class.
.. availability:: Unix.
.. _asyncore-example-1: .. _asyncore-example-1:
......
...@@ -1471,7 +1471,7 @@ functions can be used directly if desired. ...@@ -1471,7 +1471,7 @@ functions can be used directly if desired.
Encode operand according to the ANSI codepage (CP_ACP). Encode operand according to the ANSI codepage (CP_ACP).
Availability: Windows only. .. availability:: Windows only.
.. versionchanged:: 3.3 .. versionchanged:: 3.3
Support any error handler. Support any error handler.
......
...@@ -271,7 +271,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_. ...@@ -271,7 +271,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB).
*dklen* is the length of the derived key. *dklen* is the length of the derived key.
Availability: OpenSSL 1.1+ .. availability:: OpenSSL 1.1+.
.. versionadded:: 3.6 .. versionadded:: 3.6
......
...@@ -47,3 +47,16 @@ this material. ...@@ -47,3 +47,16 @@ this material.
Let the show begin! Let the show begin!
.. _availability:
Notes on availability
=====================
* An "Availability: Unix" note means that this function is commonly found on
Unix systems. It does not make any claims about its existence on a specific
operating system.
* If not separately noted, all functions that claim "Availability: Unix" are
supported on Mac OS X, which builds on a Unix core.
...@@ -260,7 +260,9 @@ than one MIME-type database; it provides an interface similar to the one of the ...@@ -260,7 +260,9 @@ than one MIME-type database; it provides an interface similar to the one of the
.. method:: MimeTypes.read_windows_registry(strict=True) .. method:: MimeTypes.read_windows_registry(strict=True)
Load MIME type information from the Windows registry. Availability: Windows. Load MIME type information from the Windows registry.
.. availability:: Windows.
If *strict* is ``True``, information will be added to the list of standard If *strict* is ``True``, information will be added to the list of standard
types, else to the list of non-standard types. types, else to the list of non-standard types.
......
...@@ -93,7 +93,7 @@ the :mod:`glob` module.) ...@@ -93,7 +93,7 @@ the :mod:`glob` module.)
pathnames, or if *paths* is empty. Unlike :func:`commonprefix`, this pathnames, or if *paths* is empty. Unlike :func:`commonprefix`, this
returns a valid path. returns a valid path.
Availability: Unix, Windows .. availability:: Unix, Windows.
.. versionadded:: 3.5 .. versionadded:: 3.5
...@@ -357,7 +357,7 @@ the :mod:`glob` module.) ...@@ -357,7 +357,7 @@ the :mod:`glob` module.)
*start* defaults to :attr:`os.curdir`. *start* defaults to :attr:`os.curdir`.
Availability: Unix, Windows. .. availability:: Unix, Windows.
.. versionchanged:: 3.6 .. versionchanged:: 3.6
Accepts a :term:`path-like object`. Accepts a :term:`path-like object`.
...@@ -369,7 +369,7 @@ the :mod:`glob` module.) ...@@ -369,7 +369,7 @@ the :mod:`glob` module.)
This is determined by the device number and i-node number and raises an This is determined by the device number and i-node number and raises an
exception if an :func:`os.stat` call on either pathname fails. exception if an :func:`os.stat` call on either pathname fails.
Availability: Unix, Windows. .. availability:: Unix, Windows.
.. versionchanged:: 3.2 .. versionchanged:: 3.2
Added Windows support. Added Windows support.
...@@ -385,7 +385,7 @@ the :mod:`glob` module.) ...@@ -385,7 +385,7 @@ the :mod:`glob` module.)
Return ``True`` if the file descriptors *fp1* and *fp2* refer to the same file. Return ``True`` if the file descriptors *fp1* and *fp2* refer to the same file.
Availability: Unix, Windows. .. availability:: Unix, Windows.
.. versionchanged:: 3.2 .. versionchanged:: 3.2
Added Windows support. Added Windows support.
...@@ -401,7 +401,7 @@ the :mod:`glob` module.) ...@@ -401,7 +401,7 @@ the :mod:`glob` module.)
:func:`os.lstat`, or :func:`os.stat`. This function implements the :func:`os.lstat`, or :func:`os.stat`. This function implements the
underlying comparison used by :func:`samefile` and :func:`sameopenfile`. underlying comparison used by :func:`samefile` and :func:`sameopenfile`.
Availability: Unix, Windows. .. availability:: Unix, Windows.
.. versionchanged:: 3.4 .. versionchanged:: 3.4
Added Windows support. Added Windows support.
......
This diff is collapsed.
...@@ -92,7 +92,7 @@ this module for those platforms. ...@@ -92,7 +92,7 @@ this module for those platforms.
:exc:`PermissionError` when the user doesn't have ``CAP_SYS_RESOURCE`` for :exc:`PermissionError` when the user doesn't have ``CAP_SYS_RESOURCE`` for
the process. the process.
Availability: Linux 2.6.36 or later with glibc 2.13 or later .. availability:: Linux 2.6.36 or later with glibc 2.13 or later.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -178,7 +178,7 @@ platform. ...@@ -178,7 +178,7 @@ platform.
The number of bytes that can be allocated for POSIX message queues. The number of bytes that can be allocated for POSIX message queues.
Availability: Linux 2.6.8 or later. .. availability:: Linux 2.6.8 or later.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -187,7 +187,7 @@ platform. ...@@ -187,7 +187,7 @@ platform.
The ceiling for the process's nice level (calculated as 20 - rlim_cur). The ceiling for the process's nice level (calculated as 20 - rlim_cur).
Availability: Linux 2.6.12 or later. .. availability:: Linux 2.6.12 or later.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -196,7 +196,7 @@ platform. ...@@ -196,7 +196,7 @@ platform.
The ceiling of the real-time priority. The ceiling of the real-time priority.
Availability: Linux 2.6.12 or later. .. availability:: Linux 2.6.12 or later.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -206,7 +206,7 @@ platform. ...@@ -206,7 +206,7 @@ platform.
The time limit (in microseconds) on CPU time that a process can spend The time limit (in microseconds) on CPU time that a process can spend
under real-time scheduling without making a blocking syscall. under real-time scheduling without making a blocking syscall.
Availability: Linux 2.6.25 or later. .. availability:: Linux 2.6.25 or later.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -215,7 +215,7 @@ platform. ...@@ -215,7 +215,7 @@ platform.
The number of signals which the process may queue. The number of signals which the process may queue.
Availability: Linux 2.6.8 or later. .. availability:: Linux 2.6.8 or later.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -225,7 +225,7 @@ platform. ...@@ -225,7 +225,7 @@ platform.
This limits the amount of network memory, and hence the amount of mbufs, This limits the amount of network memory, and hence the amount of mbufs,
that this user may hold at any time. that this user may hold at any time.
Availability: FreeBSD 9 or later. .. availability:: FreeBSD 9 or later.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -236,7 +236,7 @@ platform. ...@@ -236,7 +236,7 @@ platform.
This limit is enforced only if bit 1 of the vm.overcommit sysctl is set. This limit is enforced only if bit 1 of the vm.overcommit sysctl is set.
Please see :manpage:`tuning(7)` for a complete description of this sysctl. Please see :manpage:`tuning(7)` for a complete description of this sysctl.
Availability: FreeBSD 9 or later. .. availability:: FreeBSD 9 or later.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -244,7 +244,7 @@ platform. ...@@ -244,7 +244,7 @@ platform.
The maximum number of pseudo-terminals created by this user id. The maximum number of pseudo-terminals created by this user id.
Availability: FreeBSD 9 or later. .. availability:: FreeBSD 9 or later.
.. versionadded:: 3.4 .. versionadded:: 3.4
......
...@@ -171,7 +171,9 @@ The module defines the following: ...@@ -171,7 +171,9 @@ The module defines the following:
:func:`poll` or another interface in this module. This doesn't apply :func:`poll` or another interface in this module. This doesn't apply
to other kind of file-like objects such as sockets. to other kind of file-like objects such as sockets.
This value is guaranteed by POSIX to be at least 512. Availability: Unix. This value is guaranteed by POSIX to be at least 512.
.. availability:: Unix
.. versionadded:: 3.2 .. versionadded:: 3.2
......
...@@ -351,7 +351,7 @@ Directory and files operations ...@@ -351,7 +351,7 @@ Directory and files operations
.. versionchanged:: 3.8 .. versionchanged:: 3.8
On Windows, *path* can now be a file or directory. On Windows, *path* can now be a file or directory.
Availability: Unix, Windows. .. availability:: Unix, Windows.
.. function:: chown(path, user=None, group=None) .. function:: chown(path, user=None, group=None)
...@@ -362,7 +362,7 @@ Directory and files operations ...@@ -362,7 +362,7 @@ Directory and files operations
See also :func:`os.chown`, the underlying function. See also :func:`os.chown`, the underlying function.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
......
...@@ -106,7 +106,7 @@ The variables defined in the :mod:`signal` module are: ...@@ -106,7 +106,7 @@ The variables defined in the :mod:`signal` module are:
The signal corresponding to the :kbd:`Ctrl+C` keystroke event. This signal can The signal corresponding to the :kbd:`Ctrl+C` keystroke event. This signal can
only be used with :func:`os.kill`. only be used with :func:`os.kill`.
Availability: Windows. .. availability:: Windows.
.. versionadded:: 3.2 .. versionadded:: 3.2
...@@ -116,7 +116,7 @@ The variables defined in the :mod:`signal` module are: ...@@ -116,7 +116,7 @@ The variables defined in the :mod:`signal` module are:
The signal corresponding to the :kbd:`Ctrl+Break` keystroke event. This signal can The signal corresponding to the :kbd:`Ctrl+Break` keystroke event. This signal can
only be used with :func:`os.kill`. only be used with :func:`os.kill`.
Availability: Windows. .. availability:: Windows.
.. versionadded:: 3.2 .. versionadded:: 3.2
...@@ -193,7 +193,9 @@ The :mod:`signal` module defines the following functions: ...@@ -193,7 +193,9 @@ The :mod:`signal` module defines the following functions:
then the number of seconds before any previously set alarm was to have been then the number of seconds before any previously set alarm was to have been
delivered. If *time* is zero, no alarm is scheduled, and any scheduled alarm is delivered. If *time* is zero, no alarm is scheduled, and any scheduled alarm is
canceled. If the return value is zero, no alarm is currently scheduled. (See canceled. If the return value is zero, no alarm is currently scheduled. (See
the Unix man page :manpage:`alarm(2)`.) Availability: Unix. the Unix man page :manpage:`alarm(2)`.)
.. availability:: Unix.
.. function:: getsignal(signalnum) .. function:: getsignal(signalnum)
...@@ -252,8 +254,8 @@ The :mod:`signal` module defines the following functions: ...@@ -252,8 +254,8 @@ The :mod:`signal` module defines the following functions:
If *signalnum* is 0, then no signal is sent, but error checking is still If *signalnum* is 0, then no signal is sent, but error checking is still
performed; this can be used to check if the target thread is still running. performed; this can be used to check if the target thread is still running.
Availability: Unix (see the man page :manpage:`pthread_kill(3)` for further .. availability:: Unix (see the man page :manpage:`pthread_kill(3)` for further
information). information).
See also :func:`os.kill`. See also :func:`os.kill`.
...@@ -283,8 +285,8 @@ The :mod:`signal` module defines the following functions: ...@@ -283,8 +285,8 @@ The :mod:`signal` module defines the following functions:
For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the
signal mask of the calling thread. signal mask of the calling thread.
Availability: Unix. See the man page :manpage:`sigprocmask(3)` and .. availability:: Unix. See the man page :manpage:`sigprocmask(3)` and
:manpage:`pthread_sigmask(3)` for further information. :manpage:`pthread_sigmask(3)` for further information.
See also :func:`pause`, :func:`sigpending` and :func:`sigwait`. See also :func:`pause`, :func:`sigpending` and :func:`sigwait`.
...@@ -309,13 +311,16 @@ The :mod:`signal` module defines the following functions: ...@@ -309,13 +311,16 @@ The :mod:`signal` module defines the following functions:
The old values are returned as a tuple: (delay, interval). The old values are returned as a tuple: (delay, interval).
Attempting to pass an invalid interval timer will cause an Attempting to pass an invalid interval timer will cause an
:exc:`ItimerError`. Availability: Unix. :exc:`ItimerError`.
.. availability:: Unix.
.. function:: getitimer(which) .. function:: getitimer(which)
Returns current value of a given interval timer specified by *which*. Returns current value of a given interval timer specified by *which*.
Availability: Unix.
.. availability:: Unix.
.. function:: set_wakeup_fd(fd, *, warn_on_full_buffer=True) .. function:: set_wakeup_fd(fd, *, warn_on_full_buffer=True)
...@@ -365,8 +370,10 @@ The :mod:`signal` module defines the following functions: ...@@ -365,8 +370,10 @@ The :mod:`signal` module defines the following functions:
Change system call restart behaviour: if *flag* is :const:`False`, system Change system call restart behaviour: if *flag* is :const:`False`, system
calls will be restarted when interrupted by signal *signalnum*, otherwise calls will be restarted when interrupted by signal *signalnum*, otherwise
system calls will be interrupted. Returns nothing. Availability: Unix (see system calls will be interrupted. Returns nothing.
the man page :manpage:`siginterrupt(3)` for further information).
.. availability:: Unix (see the man page :manpage:`siginterrupt(3)`
for further information).
Note that installing a signal handler with :func:`signal` will reset the Note that installing a signal handler with :func:`signal` will reset the
restart behaviour to interruptible by implicitly calling restart behaviour to interruptible by implicitly calling
...@@ -405,8 +412,8 @@ The :mod:`signal` module defines the following functions: ...@@ -405,8 +412,8 @@ The :mod:`signal` module defines the following functions:
thread (i.e., the signals which have been raised while blocked). Return the thread (i.e., the signals which have been raised while blocked). Return the
set of the pending signals. set of the pending signals.
Availability: Unix (see the man page :manpage:`sigpending(2)` for further .. availability:: Unix (see the man page :manpage:`sigpending(2)` for further
information). information).
See also :func:`pause`, :func:`pthread_sigmask` and :func:`sigwait`. See also :func:`pause`, :func:`pthread_sigmask` and :func:`sigwait`.
...@@ -419,8 +426,8 @@ The :mod:`signal` module defines the following functions: ...@@ -419,8 +426,8 @@ The :mod:`signal` module defines the following functions:
signals specified in the signal set *sigset*. The function accepts the signal signals specified in the signal set *sigset*. The function accepts the signal
(removes it from the pending list of signals), and returns the signal number. (removes it from the pending list of signals), and returns the signal number.
Availability: Unix (see the man page :manpage:`sigwait(3)` for further .. availability:: Unix (see the man page :manpage:`sigwait(3)` for further
information). information).
See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`,
:func:`sigwaitinfo` and :func:`sigtimedwait`. :func:`sigwaitinfo` and :func:`sigtimedwait`.
...@@ -444,8 +451,8 @@ The :mod:`signal` module defines the following functions: ...@@ -444,8 +451,8 @@ The :mod:`signal` module defines the following functions:
:attr:`si_errno`, :attr:`si_pid`, :attr:`si_uid`, :attr:`si_status`, :attr:`si_errno`, :attr:`si_pid`, :attr:`si_uid`, :attr:`si_status`,
:attr:`si_band`. :attr:`si_band`.
Availability: Unix (see the man page :manpage:`sigwaitinfo(2)` for further .. availability:: Unix (see the man page :manpage:`sigwaitinfo(2)` for further
information). information).
See also :func:`pause`, :func:`sigwait` and :func:`sigtimedwait`. See also :func:`pause`, :func:`sigwait` and :func:`sigtimedwait`.
...@@ -463,8 +470,8 @@ The :mod:`signal` module defines the following functions: ...@@ -463,8 +470,8 @@ The :mod:`signal` module defines the following functions:
specifying a timeout. If *timeout* is specified as :const:`0`, a poll is specifying a timeout. If *timeout* is specified as :const:`0`, a poll is
performed. Returns :const:`None` if a timeout occurs. performed. Returns :const:`None` if a timeout occurs.
Availability: Unix (see the man page :manpage:`sigtimedwait(2)` for further .. availability:: Unix (see the man page :manpage:`sigtimedwait(2)` for further
information). information).
See also :func:`pause`, :func:`sigwait` and :func:`sigwaitinfo`. See also :func:`pause`, :func:`sigwait` and :func:`sigwaitinfo`.
......
...@@ -161,7 +161,7 @@ created. Socket addresses are represented as follows: ...@@ -161,7 +161,7 @@ created. Socket addresses are represented as follows:
- *feat* and *mask* are unsigned 32bit integers. - *feat* and *mask* are unsigned 32bit integers.
Availability Linux 2.6.38, some algorithm types require more recent Kernels. .. availability:: Linux 2.6.38, some algorithm types require more recent Kernels.
.. versionadded:: 3.6 .. versionadded:: 3.6
...@@ -169,7 +169,7 @@ created. Socket addresses are represented as follows: ...@@ -169,7 +169,7 @@ created. Socket addresses are represented as follows:
their hosts. The sockets are represented as a ``(CID, port)`` tuple their hosts. The sockets are represented as a ``(CID, port)`` tuple
where the context ID or CID and port are integers. where the context ID or CID and port are integers.
Availability: Linux >= 4.8 QEMU >= 2.8 ESX >= 4.0 ESX Workstation >= 6.5 .. availability:: Linux >= 4.8 QEMU >= 2.8 ESX >= 4.0 ESX Workstation >= 6.5.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -313,7 +313,7 @@ Constants ...@@ -313,7 +313,7 @@ Constants
`Secure File Descriptor Handling <http://udrepper.livejournal.com/20407.html>`_ `Secure File Descriptor Handling <http://udrepper.livejournal.com/20407.html>`_
for a more thorough explanation. for a more thorough explanation.
Availability: Linux >= 2.6.27. .. availability:: Linux >= 2.6.27.
.. versionadded:: 3.2 .. versionadded:: 3.2
...@@ -361,7 +361,7 @@ Constants ...@@ -361,7 +361,7 @@ Constants
Many constants of these forms, documented in the Linux documentation, are Many constants of these forms, documented in the Linux documentation, are
also defined in the socket module. also defined in the socket module.
Availability: Linux >= 2.6.25. .. availability:: Linux >= 2.6.25.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -372,7 +372,7 @@ Constants ...@@ -372,7 +372,7 @@ Constants
Broadcast manager constants, documented in the Linux documentation, are also Broadcast manager constants, documented in the Linux documentation, are also
defined in the socket module. defined in the socket module.
Availability: Linux >= 2.6.25. .. availability:: Linux >= 2.6.25.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -384,7 +384,7 @@ Constants ...@@ -384,7 +384,7 @@ Constants
This constant is documented in the Linux documentation. This constant is documented in the Linux documentation.
Availability: Linux >= 3.6. .. availability:: Linux >= 3.6.
.. versionadded:: 3.5 .. versionadded:: 3.5
...@@ -393,7 +393,7 @@ Constants ...@@ -393,7 +393,7 @@ Constants
CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol.
ISO-TP constants, documented in the Linux documentation. ISO-TP constants, documented in the Linux documentation.
Availability: Linux >= 2.6.25 .. availability:: Linux >= 2.6.25.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -405,7 +405,7 @@ Constants ...@@ -405,7 +405,7 @@ Constants
Many constants of these forms, documented in the Linux documentation, are Many constants of these forms, documented in the Linux documentation, are
also defined in the socket module. also defined in the socket module.
Availability: Linux >= 2.2. .. availability:: Linux >= 2.2.
.. data:: AF_RDS .. data:: AF_RDS
...@@ -416,7 +416,7 @@ Constants ...@@ -416,7 +416,7 @@ Constants
Many constants of these forms, documented in the Linux documentation, are Many constants of these forms, documented in the Linux documentation, are
also defined in the socket module. also defined in the socket module.
Availability: Linux >= 2.6.30. .. availability:: Linux >= 2.6.30.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -444,7 +444,7 @@ Constants ...@@ -444,7 +444,7 @@ Constants
Constants for Linux Kernel cryptography. Constants for Linux Kernel cryptography.
Availability: Linux >= 2.6.38. .. availability:: Linux >= 2.6.38.
.. versionadded:: 3.6 .. versionadded:: 3.6
...@@ -456,13 +456,13 @@ Constants ...@@ -456,13 +456,13 @@ Constants
Constants for Linux host/guest communication. Constants for Linux host/guest communication.
Availability: Linux >= 4.8. .. availability:: Linux >= 4.8.
.. versionadded:: 3.7 .. versionadded:: 3.7
.. data:: AF_LINK .. data:: AF_LINK
Availability: BSD, OSX. .. availability:: BSD, OSX.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -493,7 +493,7 @@ Constants ...@@ -493,7 +493,7 @@ Constants
Constant for Qualcomm's IPC router protocol, used to communicate with Constant for Qualcomm's IPC router protocol, used to communicate with
service providing remote processors. service providing remote processors.
Availability: Linux >= 4.7. .. availability:: Linux >= 4.7.
Functions Functions
^^^^^^^^^ ^^^^^^^^^
...@@ -618,7 +618,7 @@ The following functions all create :ref:`socket objects <socket-objects>`. ...@@ -618,7 +618,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
Instantiate a socket from data obtained from the :meth:`socket.share` Instantiate a socket from data obtained from the :meth:`socket.share`
method. The socket is assumed to be in blocking mode. method. The socket is assumed to be in blocking mode.
Availability: Windows. .. availability:: Windows.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -865,7 +865,7 @@ The :mod:`socket` module also offers various network-related services: ...@@ -865,7 +865,7 @@ The :mod:`socket` module also offers various network-related services:
both the value of *address_family* and the underlying implementation of both the value of *address_family* and the underlying implementation of
:c:func:`inet_pton`. :c:func:`inet_pton`.
Availability: Unix (maybe not all platforms), Windows. .. availability:: Unix (maybe not all platforms), Windows.
.. versionchanged:: 3.4 .. versionchanged:: 3.4
Windows support added Windows support added
...@@ -885,7 +885,7 @@ The :mod:`socket` module also offers various network-related services: ...@@ -885,7 +885,7 @@ The :mod:`socket` module also offers various network-related services:
length for the specified address family, :exc:`ValueError` will be raised. length for the specified address family, :exc:`ValueError` will be raised.
:exc:`OSError` is raised for errors from the call to :func:`inet_ntop`. :exc:`OSError` is raised for errors from the call to :func:`inet_ntop`.
Availability: Unix (maybe not all platforms), Windows. .. availability:: Unix (maybe not all platforms), Windows.
.. versionchanged:: 3.4 .. versionchanged:: 3.4
Windows support added Windows support added
...@@ -911,7 +911,7 @@ The :mod:`socket` module also offers various network-related services: ...@@ -911,7 +911,7 @@ The :mod:`socket` module also offers various network-related services:
buffer. Raises :exc:`OverflowError` if *length* is outside the buffer. Raises :exc:`OverflowError` if *length* is outside the
permissible range of values. permissible range of values.
Availability: most Unix platforms, possibly others. .. availability:: most Unix platforms, possibly others.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -932,7 +932,7 @@ The :mod:`socket` module also offers various network-related services: ...@@ -932,7 +932,7 @@ The :mod:`socket` module also offers various network-related services:
amount of ancillary data that can be received, since additional amount of ancillary data that can be received, since additional
data may be able to fit into the padding area. data may be able to fit into the padding area.
Availability: most Unix platforms, possibly others. .. availability:: most Unix platforms, possibly others.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -957,7 +957,7 @@ The :mod:`socket` module also offers various network-related services: ...@@ -957,7 +957,7 @@ The :mod:`socket` module also offers various network-related services:
Set the machine's hostname to *name*. This will raise an Set the machine's hostname to *name*. This will raise an
:exc:`OSError` if you don't have enough rights. :exc:`OSError` if you don't have enough rights.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -968,7 +968,7 @@ The :mod:`socket` module also offers various network-related services: ...@@ -968,7 +968,7 @@ The :mod:`socket` module also offers various network-related services:
(index int, name string) tuples. (index int, name string) tuples.
:exc:`OSError` if the system call fails. :exc:`OSError` if the system call fails.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -979,7 +979,7 @@ The :mod:`socket` module also offers various network-related services: ...@@ -979,7 +979,7 @@ The :mod:`socket` module also offers various network-related services:
interface name. interface name.
:exc:`OSError` if no interface with the given name exists. :exc:`OSError` if no interface with the given name exists.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -990,7 +990,7 @@ The :mod:`socket` module also offers various network-related services: ...@@ -990,7 +990,7 @@ The :mod:`socket` module also offers various network-related services:
interface index number. interface index number.
:exc:`OSError` if no interface with the given index exists. :exc:`OSError` if no interface with the given index exists.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -1317,7 +1317,7 @@ to sockets. ...@@ -1317,7 +1317,7 @@ to sockets.
fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)]) fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
return msg, list(fds) return msg, list(fds)
Availability: most Unix platforms, possibly others. .. availability:: most Unix platforms, possibly others.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -1359,7 +1359,7 @@ to sockets. ...@@ -1359,7 +1359,7 @@ to sockets.
>>> [b1, b2, b3] >>> [b1, b2, b3]
[bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')] [bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')]
Availability: most Unix platforms, possibly others. .. availability:: most Unix platforms, possibly others.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -1463,7 +1463,7 @@ to sockets. ...@@ -1463,7 +1463,7 @@ to sockets.
def send_fds(sock, msg, fds): def send_fds(sock, msg, fds):
return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array("i", fds))]) return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array("i", fds))])
Availability: most Unix platforms, possibly others. .. availability:: most Unix platforms, possibly others.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -1477,7 +1477,7 @@ to sockets. ...@@ -1477,7 +1477,7 @@ to sockets.
Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket.
Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` socket. Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` socket.
Availability: Linux >= 2.6.38 .. availability:: Linux >= 2.6.38.
.. versionadded:: 3.6 .. versionadded:: 3.6
...@@ -1578,7 +1578,7 @@ to sockets. ...@@ -1578,7 +1578,7 @@ to sockets.
Once this method has been called, it is safe to close the socket since Once this method has been called, it is safe to close the socket since
the operating system has already duplicated it for the target process. the operating system has already duplicated it for the target process.
Availability: Windows. .. availability:: Windows.
.. versionadded:: 3.3 .. versionadded:: 3.3
......
...@@ -328,7 +328,7 @@ Random generation ...@@ -328,7 +328,7 @@ Random generation
See http://egd.sourceforge.net/ or http://prngd.sourceforge.net/ for sources See http://egd.sourceforge.net/ or http://prngd.sourceforge.net/ for sources
of entropy-gathering daemons. of entropy-gathering daemons.
Availability: not available with LibreSSL and OpenSSL > 1.1.0 .. availability:: not available with LibreSSL and OpenSSL > 1.1.0.
.. function:: RAND_add(bytes, entropy) .. function:: RAND_add(bytes, entropy)
...@@ -460,8 +460,8 @@ Certificate handling ...@@ -460,8 +460,8 @@ Certificate handling
* :attr:`openssl_capath_env` - OpenSSL's environment key that points to a capath, * :attr:`openssl_capath_env` - OpenSSL's environment key that points to a capath,
* :attr:`openssl_capath` - hard coded path to a capath directory * :attr:`openssl_capath` - hard coded path to a capath directory
Availability: LibreSSL ignores the environment vars .. availability:: LibreSSL ignores the environment vars
:attr:`openssl_cafile_env` and :attr:`openssl_capath_env` :attr:`openssl_cafile_env` and :attr:`openssl_capath_env`.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -484,7 +484,7 @@ Certificate handling ...@@ -484,7 +484,7 @@ Certificate handling
[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}), [(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),
(b'data...', 'x509_asn', True)] (b'data...', 'x509_asn', True)]
Availability: Windows. .. availability:: Windows.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -499,7 +499,7 @@ Certificate handling ...@@ -499,7 +499,7 @@ Certificate handling
:const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for
PKCS#7 ASN.1 data. PKCS#7 ASN.1 data.
Availability: Windows. .. availability:: Windows.
.. versionadded:: 3.4 .. versionadded:: 3.4
...@@ -1610,7 +1610,7 @@ to speed up repeated connections from the same clients. ...@@ -1610,7 +1610,7 @@ to speed up repeated connections from the same clients.
'strength_bits': 128, 'strength_bits': 128,
'symmetric': 'aes-128-gcm'}] 'symmetric': 'aes-128-gcm'}]
Availability: OpenSSL 1.0.2+ .. availability:: OpenSSL 1.0.2+.
.. versionadded:: 3.6 .. versionadded:: 3.6
......
...@@ -1330,7 +1330,7 @@ handling consistency are valid for these functions. ...@@ -1330,7 +1330,7 @@ handling consistency are valid for these functions.
>>> subprocess.getstatusoutput('/bin/kill $$') >>> subprocess.getstatusoutput('/bin/kill $$')
(-15, '') (-15, '')
Availability: POSIX & Windows .. availability:: POSIX & Windows.
.. versionchanged:: 3.3.4 .. versionchanged:: 3.3.4
Windows support was added. Windows support was added.
...@@ -1350,7 +1350,7 @@ handling consistency are valid for these functions. ...@@ -1350,7 +1350,7 @@ handling consistency are valid for these functions.
>>> subprocess.getoutput('ls /bin/ls') >>> subprocess.getoutput('ls /bin/ls')
'/bin/ls' '/bin/ls'
Availability: POSIX & Windows .. availability:: POSIX & Windows.
.. versionchanged:: 3.3.4 .. versionchanged:: 3.3.4
Windows support added Windows support added
......
...@@ -161,7 +161,9 @@ always available. ...@@ -161,7 +161,9 @@ always available.
.. data:: dllhandle .. data:: dllhandle
Integer specifying the handle of the Python DLL. Availability: Windows. Integer specifying the handle of the Python DLL.
.. availability:: Windows.
.. function:: displayhook(value) .. function:: displayhook(value)
...@@ -477,7 +479,7 @@ always available. ...@@ -477,7 +479,7 @@ always available.
Return the build time API version of Android as an integer. Return the build time API version of Android as an integer.
Availability: Android. .. availability:: Android.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -501,7 +503,9 @@ always available. ...@@ -501,7 +503,9 @@ always available.
Return the current value of the flags that are used for Return the current value of the flags that are used for
:c:func:`dlopen` calls. Symbolic names for the flag values can be :c:func:`dlopen` calls. Symbolic names for the flag values can be
found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. found in the :mod:`os` module (``RTLD_xxx`` constants, e.g.
:data:`os.RTLD_LAZY`). Availability: Unix. :data:`os.RTLD_LAZY`).
.. availability:: Unix.
.. function:: getfilesystemencoding() .. function:: getfilesystemencoding()
...@@ -669,7 +673,7 @@ always available. ...@@ -669,7 +673,7 @@ always available.
is being emulated for the process. It is intended for use in logging rather is being emulated for the process. It is intended for use in logging rather
than for feature detection. than for feature detection.
Availability: Windows. .. availability:: Windows.
.. versionchanged:: 3.2 .. versionchanged:: 3.2
Changed to a named tuple and added *service_pack_minor*, Changed to a named tuple and added *service_pack_minor*,
...@@ -1094,7 +1098,7 @@ always available. ...@@ -1094,7 +1098,7 @@ always available.
can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g.
:data:`os.RTLD_LAZY`). :data:`os.RTLD_LAZY`).
Availability: Unix. .. availability:: Unix.
.. function:: setprofile(profilefunc) .. function:: setprofile(profilefunc)
...@@ -1340,7 +1344,7 @@ always available. ...@@ -1340,7 +1344,7 @@ always available.
This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING`
environment variable before launching Python. environment variable before launching Python.
Availability: Windows .. availability:: Windows.
.. versionadded:: 3.6 .. versionadded:: 3.6
See :pep:`529` for more details. See :pep:`529` for more details.
...@@ -1486,7 +1490,9 @@ always available. ...@@ -1486,7 +1490,9 @@ always available.
stored as string resource 1000 in the Python DLL. The value is normally the stored as string resource 1000 in the Python DLL. The value is normally the
first three characters of :const:`version`. It is provided in the :mod:`sys` first three characters of :const:`version`. It is provided in the :mod:`sys`
module for informational purposes; modifying this value has no effect on the module for informational purposes; modifying this value has no effect on the
registry keys used by Python. Availability: Windows. registry keys used by Python.
.. availability:: Windows.
.. data:: _xoptions .. data:: _xoptions
......
...@@ -100,7 +100,8 @@ This module defines the following functions: ...@@ -100,7 +100,8 @@ This module defines the following functions:
memory page size - platform documentation should be referred to for more memory page size - platform documentation should be referred to for more
information (4 KiB pages are common; using multiples of 4096 for the stack size is information (4 KiB pages are common; using multiples of 4096 for the stack size is
the suggested approach in the absence of more specific information). the suggested approach in the absence of more specific information).
Availability: Windows, systems with POSIX threads.
.. availability:: Windows, systems with POSIX threads.
This module also defines the following constant: This module also defines the following constant:
......
...@@ -170,8 +170,8 @@ Functions ...@@ -170,8 +170,8 @@ Functions
Passing an invalid or expired *thread_id* may result in Passing an invalid or expired *thread_id* may result in
undefined behavior, such as segmentation fault. undefined behavior, such as segmentation fault.
Availability: Unix (see the man page for :manpage:`pthread_getcpuclockid(3)` for .. availability:: Unix (see the man page for :manpage:`pthread_getcpuclockid(3)` for
further information) further information).
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -180,7 +180,7 @@ Functions ...@@ -180,7 +180,7 @@ Functions
Return the resolution (precision) of the specified clock *clk_id*. Refer to Return the resolution (precision) of the specified clock *clk_id*. Refer to
:ref:`time-clock-id-constants` for a list of accepted values for *clk_id*. :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -190,7 +190,7 @@ Functions ...@@ -190,7 +190,7 @@ Functions
Return the time of the specified clock *clk_id*. Refer to Return the time of the specified clock *clk_id*. Refer to
:ref:`time-clock-id-constants` for a list of accepted values for *clk_id*. :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -199,7 +199,7 @@ Functions ...@@ -199,7 +199,7 @@ Functions
Similar to :func:`clock_gettime` but return time as nanoseconds. Similar to :func:`clock_gettime` but return time as nanoseconds.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -209,7 +209,7 @@ Functions ...@@ -209,7 +209,7 @@ Functions
Set the time of the specified clock *clk_id*. Currently, Set the time of the specified clock *clk_id*. Currently,
:data:`CLOCK_REALTIME` is the only accepted value for *clk_id*. :data:`CLOCK_REALTIME` is the only accepted value for *clk_id*.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -218,7 +218,7 @@ Functions ...@@ -218,7 +218,7 @@ Functions
Similar to :func:`clock_settime` but set time with nanoseconds. Similar to :func:`clock_settime` but set time with nanoseconds.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -617,8 +617,8 @@ Functions ...@@ -617,8 +617,8 @@ Functions
returned value is undefined, so that only the difference between the results returned value is undefined, so that only the difference between the results
of consecutive calls in the same thread is valid. of consecutive calls in the same thread is valid.
Availability: Windows, Linux, Unix systems supporting .. availability:: Windows, Linux, Unix systems supporting
``CLOCK_THREAD_CPUTIME_ID``. ``CLOCK_THREAD_CPUTIME_ID``.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -647,7 +647,7 @@ Functions ...@@ -647,7 +647,7 @@ Functions
nonzero if there is a time, past, present or future when daylight saving time nonzero if there is a time, past, present or future when daylight saving time
applies). applies).
Availability: Unix. .. availability:: Unix.
.. note:: .. note::
...@@ -743,7 +743,7 @@ These constants are used as parameters for :func:`clock_getres` and ...@@ -743,7 +743,7 @@ These constants are used as parameters for :func:`clock_getres` and
have discontinuities if the time is changed using ``settimeofday()`` or have discontinuities if the time is changed using ``settimeofday()`` or
similar. similar.
Availability: Linux 2.6.39 or later. .. availability:: Linux 2.6.39 or later.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -754,7 +754,7 @@ These constants are used as parameters for :func:`clock_getres` and ...@@ -754,7 +754,7 @@ These constants are used as parameters for :func:`clock_getres` and
hardware source, and may give close to nanosecond resolution. hardware source, and may give close to nanosecond resolution.
``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock. ``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock.
Availability: Solaris. .. availability:: Solaris.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -764,7 +764,7 @@ These constants are used as parameters for :func:`clock_getres` and ...@@ -764,7 +764,7 @@ These constants are used as parameters for :func:`clock_getres` and
Clock that cannot be set and represents monotonic time since some unspecified Clock that cannot be set and represents monotonic time since some unspecified
starting point. starting point.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -783,7 +783,7 @@ These constants are used as parameters for :func:`clock_getres` and ...@@ -783,7 +783,7 @@ These constants are used as parameters for :func:`clock_getres` and
High-resolution per-process timer from the CPU. High-resolution per-process timer from the CPU.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
...@@ -792,7 +792,7 @@ These constants are used as parameters for :func:`clock_getres` and ...@@ -792,7 +792,7 @@ These constants are used as parameters for :func:`clock_getres` and
High-resolution per-process timer from the CPU. High-resolution per-process timer from the CPU.
Availability: FreeBSD, NetBSD 7 or later, OpenBSD. .. availability:: FreeBSD, NetBSD 7 or later, OpenBSD.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -812,7 +812,7 @@ These constants are used as parameters for :func:`clock_getres` and ...@@ -812,7 +812,7 @@ These constants are used as parameters for :func:`clock_getres` and
suspended, providing accurate uptime measurement, both absolute and suspended, providing accurate uptime measurement, both absolute and
interval. interval.
Availability: FreeBSD, OpenBSD 5.5 or later. .. availability:: FreeBSD, OpenBSD 5.5 or later.
.. versionadded:: 3.7 .. versionadded:: 3.7
...@@ -825,7 +825,7 @@ The following constant is the only parameter that can be sent to ...@@ -825,7 +825,7 @@ The following constant is the only parameter that can be sent to
System-wide real-time clock. Setting this clock requires appropriate System-wide real-time clock. Setting this clock requires appropriate
privileges. privileges.
Availability: Unix. .. availability:: Unix.
.. versionadded:: 3.3 .. versionadded:: 3.3
......
...@@ -131,6 +131,25 @@ class ImplementationDetail(Directive): ...@@ -131,6 +131,25 @@ class ImplementationDetail(Directive):
return [pnode] return [pnode]
# Support for documenting platform availability
class Availability(Directive):
has_content = False
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = True
def run(self):
pnode = nodes.paragraph(classes=['availability'])
n, m = self.state.inline_text(':ref:`Availability <availability>`: ',
self.lineno)
pnode.extend(n + m)
n, m = self.state.inline_text(self.arguments[0], self.lineno)
pnode.extend(n + m)
return [pnode]
# Support for documenting decorators # Support for documenting decorators
class PyDecoratorMixin(object): class PyDecoratorMixin(object):
...@@ -401,6 +420,7 @@ def setup(app): ...@@ -401,6 +420,7 @@ def setup(app):
app.add_role('issue', issue_role) app.add_role('issue', issue_role)
app.add_role('source', source_role) app.add_role('source', source_role)
app.add_directive('impl-detail', ImplementationDetail) app.add_directive('impl-detail', ImplementationDetail)
app.add_directive('availability', Availability)
app.add_directive('deprecated-removed', DeprecatedRemoved) app.add_directive('deprecated-removed', DeprecatedRemoved)
app.add_builder(PydocTopicsBuilder) app.add_builder(PydocTopicsBuilder)
app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_builder(suspicious.CheckSuspiciousMarkupBuilder)
......
...@@ -27,17 +27,18 @@ directives = [ ...@@ -27,17 +27,18 @@ directives = [
'table', 'target-notes', 'tip', 'title', 'topic', 'unicode', 'warning', 'table', 'target-notes', 'tip', 'title', 'topic', 'unicode', 'warning',
# Sphinx and Python docs custom ones # Sphinx and Python docs custom ones
'acks', 'attribute', 'autoattribute', 'autoclass', 'autodata', 'acks', 'attribute', 'autoattribute', 'autoclass', 'autodata',
'autoexception', 'autofunction', 'automethod', 'automodule', 'centered', 'autoexception', 'autofunction', 'automethod', 'automodule',
'cfunction', 'class', 'classmethod', 'cmacro', 'cmdoption', 'cmember', 'availability', 'centered', 'cfunction', 'class', 'classmethod', 'cmacro',
'code-block', 'confval', 'cssclass', 'ctype', 'currentmodule', 'cvar', 'cmdoption', 'cmember', 'code-block', 'confval', 'cssclass', 'ctype',
'data', 'decorator', 'decoratormethod', 'deprecated-removed', 'currentmodule', 'cvar', 'data', 'decorator', 'decoratormethod',
'deprecated(?!-removed)', 'describe', 'directive', 'doctest', 'envvar', 'deprecated-removed', 'deprecated(?!-removed)', 'describe', 'directive',
'event', 'exception', 'function', 'glossary', 'highlight', 'highlightlang', 'doctest', 'envvar', 'event', 'exception', 'function', 'glossary',
'impl-detail', 'index', 'literalinclude', 'method', 'miscnews', 'module', 'highlight', 'highlightlang', 'impl-detail', 'index', 'literalinclude',
'moduleauthor', 'opcode', 'pdbcommand', 'productionlist', 'method', 'miscnews', 'module', 'moduleauthor', 'opcode', 'pdbcommand',
'program', 'role', 'sectionauthor', 'seealso', 'sourcecode', 'staticmethod', 'productionlist', 'program', 'role', 'sectionauthor', 'seealso',
'tabularcolumns', 'testcode', 'testoutput', 'testsetup', 'toctree', 'todo', 'sourcecode', 'staticmethod', 'tabularcolumns', 'testcode', 'testoutput',
'todolist', 'versionadded', 'versionchanged' 'testsetup', 'toctree', 'todo', 'todolist', 'versionadded',
'versionchanged'
] ]
all_directives = '(' + '|'.join(directives) + ')' all_directives = '(' + '|'.join(directives) + ')'
......
...@@ -785,7 +785,7 @@ conflict. ...@@ -785,7 +785,7 @@ conflict.
This may also be enabled at runtime with This may also be enabled at runtime with
:func:`sys._enablelegacywindowsfsencoding()`. :func:`sys._enablelegacywindowsfsencoding()`.
Availability: Windows .. availability:: Windows.
.. versionadded:: 3.6 .. versionadded:: 3.6
See :pep:`529` for more details. See :pep:`529` for more details.
...@@ -799,7 +799,7 @@ conflict. ...@@ -799,7 +799,7 @@ conflict.
This variable is ignored if the standard streams are redirected (to files This variable is ignored if the standard streams are redirected (to files
or pipes) rather than referring to console buffers. or pipes) rather than referring to console buffers.
Availability: Windows .. availability:: Windows.
.. versionadded:: 3.6 .. versionadded:: 3.6
...@@ -850,7 +850,7 @@ conflict. ...@@ -850,7 +850,7 @@ conflict.
order to force the interpreter to use ``ASCII`` instead of ``UTF-8`` for order to force the interpreter to use ``ASCII`` instead of ``UTF-8`` for
system interfaces. system interfaces.
Availability: \*nix .. availability:: \*nix.
.. versionadded:: 3.7 .. versionadded:: 3.7
See :pep:`538` for more details. See :pep:`538` for more details.
...@@ -911,7 +911,7 @@ conflict. ...@@ -911,7 +911,7 @@ conflict.
Also available as the :option:`-X` ``utf8`` option. Also available as the :option:`-X` ``utf8`` option.
Availability: \*nix .. availability:: \*nix.
.. versionadded:: 3.7 .. versionadded:: 3.7
See :pep:`540` for more details. See :pep:`540` for more details.
......
Create availability directive for documentation. Original patch by Georg
Brandl.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment