diff options
| author | Bas van Beek <b.f.van.beek@vu.nl> | 2021-06-22 09:23:50 +0200 |
|---|---|---|
| committer | Bas van Beek <b.f.van.beek@vu.nl> | 2021-06-22 11:44:39 +0200 |
| commit | 82d991c9fbdab578670c6fc66b254c97c4a8446f (patch) | |
| tree | 02f1bc57f765ead111130409d8b40dd0d63ea406 | |
| parent | fbe39c404c194f2ea4283bfba2a786ac01cedf03 (diff) | |
| download | numpy-82d991c9fbdab578670c6fc66b254c97c4a8446f.tar.gz | |
DOC: Add `versionadded` directives to `numpy.typing`
| -rw-r--r-- | numpy/typing/__init__.py | 6 | ||||
| -rw-r--r-- | numpy/typing/_add_docstring.py | 6 | ||||
| -rw-r--r-- | numpy/typing/mypy_plugin.py | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/numpy/typing/__init__.py b/numpy/typing/__init__.py index 3f5bb204f..05efe61df 100644 --- a/numpy/typing/__init__.py +++ b/numpy/typing/__init__.py @@ -3,6 +3,8 @@ Typing (:mod:`numpy.typing`) ============================ +.. versionadded:: 1.20 + .. warning:: Some of the types in this module rely on features only present in @@ -22,6 +24,8 @@ the two below: Mypy plugin ----------- +.. versionadded:: 1.21 + .. automodule:: numpy.typing.mypy_plugin Differences from the runtime NumPy API @@ -180,6 +184,8 @@ class NBitBase: Each subsequent subclass is herein used for representing a lower level of precision, *e.g.* ``64Bit > 32Bit > 16Bit``. + .. versionadded:: 1.20 + Examples -------- Below is a typical usage example: `NBitBase` is herein used for annotating a diff --git a/numpy/typing/_add_docstring.py b/numpy/typing/_add_docstring.py index 56ef41cfd..846b67042 100644 --- a/numpy/typing/_add_docstring.py +++ b/numpy/typing/_add_docstring.py @@ -67,6 +67,8 @@ add_newdoc('ArrayLike', 'typing.Union[...]', * (Nested) sequences. * Objects implementing the `~class.__array__` protocol. + .. versionadded:: 1.20 + See Also -------- :term:`array_like`: @@ -94,6 +96,8 @@ add_newdoc('DTypeLike', 'typing.Union[...]', * Character codes or the names of :class:`type` objects. * Objects with the ``.dtype`` attribute. + .. versionadded:: 1.20 + See Also -------- :ref:`Specifying and constructing data types <arrays.dtypes.constructing>` @@ -119,6 +123,8 @@ add_newdoc('NDArray', repr(NDArray), Can be used during runtime for typing arrays with a given dtype and unspecified shape. + .. versionadded:: 1.21 + Examples -------- .. code-block:: python diff --git a/numpy/typing/mypy_plugin.py b/numpy/typing/mypy_plugin.py index d698673fc..02bd18887 100644 --- a/numpy/typing/mypy_plugin.py +++ b/numpy/typing/mypy_plugin.py @@ -12,9 +12,9 @@ Its functionality can be split into three distinct parts: likes of `~numpy.float128` and `~numpy.complex256`. Without the plugin *all* extended-precision types will, as far as mypy is concerned, be available to all platforms. -* Assigning the (platform-dependent) precision of `~numpy.ctypeslib.c_intp`. - Without the plugin aforementioned type will default to `ctypes.c_int64`. - +* .. versionadded:: 1.22 + Assigning the (platform-dependent) precision of `~numpy.ctypeslib.c_intp`. + Without the plugin aforementioned type will default to `ctypes.c_int64`. Examples -------- |
