summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik1123 <15989985+Dominik1123@users.noreply.github.com>2020-11-16 01:30:55 (GMT)
committerGitHub <noreply@github.com>2020-11-16 01:30:55 (GMT)
commitc3b9592244a9112d8af9610ff1c4e1e4cd4bfaca (patch)
treebb828d566663902449defdf65c90624b5992e67f
parenta26215db11cfcf7b5f55cab9e91396761a0e0bcf (diff)
downloadcpython-c3b9592244a9112d8af9610ff1c4e1e4cd4bfaca.zip
cpython-c3b9592244a9112d8af9610ff1c4e1e4cd4bfaca.tar.gz
cpython-c3b9592244a9112d8af9610ff1c4e1e4cd4bfaca.tar.bz2
bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254)
-rw-r--r--Doc/library/typing.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 9a993c0..a8de984 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -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::