]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254)
authorDominik1123 <15989985+Dominik1123@users.noreply.github.com>
Mon, 16 Nov 2020 01:30:55 +0000 (02:30 +0100)
committerGitHub <noreply@github.com>
Mon, 16 Nov 2020 01:30:55 +0000 (17:30 -0800)
Doc/library/typing.rst

index 9a993c073277f9c519d8926bdec62738bc8ade74..a8de984a5ce41b63cd1bdb945bde9d6c1b1a9877 100644 (file)
@@ -1706,6 +1706,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::