8000 bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254) · python/cpython@2369759 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 2369759

Browse files
bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254)
(cherry picked from commit c3b9592) Co-authored-by: Dominik1123 <15989985+Dominik1123@users.noreply.github.com>
1 parent 2837241 commit 2369759

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/library/typing.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,6 +1687,9 @@ Introspection helpers
16871687
For a typing object of the form ``X[Y, Z, ...]`` these functions return
16881688
``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or
16891689
:mod:`collections` class, it gets normalized to the original class.
1690+
If ``X`` is a :class:`Union` contained in another generic type,
1691+
the order of ``(Y, Z, ...)`` may be different from the order of
1692+
the original arguments ``[Y, Z, ...]`` due to type caching.
16901693
For unsupported objects return ``None`` and ``()`` correspondingly.
16911694
Examples::
16921695

0 commit comments

Comments
 (0)
0