diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2023-04-21 10:24:27 +0200 |
---|---|---|
committer | scoder <stefan_ml@behnel.de> | 2023-04-24 16:05:24 +0200 |
commit | 3fa5510872ee38b8019429b1bc360dce72ec2179 (patch) | |
tree | 841a9920f9b591a260f9021278f84c8817d74c95 | |
parent | 07a72c33dcceb861600449682aa4ed2492b5ac00 (diff) | |
download | cython-3fa5510872ee38b8019429b1bc360dce72ec2179.tar.gz |
docs: change "(...)" ctuple syntax to "tuple[...]" in Python annotations.
-rw-r--r-- | docs/examples/userguide/numpy_ufuncs/ufunc_ctuple.py | 2 | ||||
-rw-r--r-- | docs/src/userguide/language_basics.rst | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/docs/examples/userguide/numpy_ufuncs/ufunc_ctuple.py b/docs/examples/userguide/numpy_ufuncs/ufunc_ctuple.py index 75093d6a9..1bae902f9 100644 --- a/docs/examples/userguide/numpy_ufuncs/ufunc_ctuple.py +++ b/docs/examples/userguide/numpy_ufuncs/ufunc_ctuple.py @@ -3,5 +3,5 @@ import cython @cython.cfunc @cython.ufunc -def add_one_add_two(x: cython.int) -> (cython.int, cython.int): +def add_one_add_two(x: cython.int) -> tuple[cython.int, cython.int]: return x+1, x+2 diff --git a/docs/src/userguide/language_basics.rst b/docs/src/userguide/language_basics.rst index 41a7b9392..aa057dd98 100644 --- a/docs/src/userguide/language_basics.rst +++ b/docs/src/userguide/language_basics.rst @@ -348,7 +348,7 @@ A ``ctuple`` is assembled from any valid C types. For example .. code-block:: python def main(): - bar: (cython.double, cython.int) + bar: tuple[cython.double, cython.int] .. group-tab:: Cython @@ -496,7 +496,7 @@ using normal C declaration syntax. For example, .. code-block:: python @cython.cfunc - def chips(t: (cython.long, cython.long, cython.double)) -> (cython.int, cython.float): + def chips(t: tuple[cython.long, cython.long, cython.double]) -> tuple[cython.int, cython.float]: ... .. group-tab:: Cython |