]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 16 Nov 2020 01:52:22 +0000 (17:52 -0800)
committerGitHub <noreply@github.com>
Mon, 16 Nov 2020 01:52:22 +0000 (17:52 -0800)
(cherry picked from commit c3b9592244a9112d8af9610ff1c4e1e4cd4bfaca)

Co-authored-by: Dominik1123 <15989985+Dominik1123@users.noreply.github.com>
Doc/library/typing.rst

index a5f8b0403f8031c0cfd347f9941fbce8544526eb..324abdeb5eb5bbe2cf3104d6891ff8ee925e50a7 100644 (file)
@@ -1687,6 +1687,9 @@ Introspection helpers
    For a typing object of the form ``X[Y, Z, ...]`` these functions return
    ``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or
    :mod:`collections` class, it gets normalized to the original class.
+   If ``X`` is a :class:`Union` contained in another generic type,
+   the order of ``(Y, Z, ...)`` may be different from the order of
+   the original arguments ``[Y, Z, ...]`` due to type caching.
    For unsupported objects return ``None`` and ``()`` correspondingly.
    Examples::