Skip to content

Commit c3b9592

Browse files
authored
bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254)
1 parent a26215d commit c3b9592

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
@@ -1706,6 +1706,9 @@ Introspection helpers
17061706
For a typing object of the form ``X[Y, Z, ...]`` these functions return
17071707
``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or
17081708
:mod:`collections` class, it gets normalized to the original class.
1709+
If ``X`` is a :class:`Union` contained in another generic type,
1710+
the order of ``(Y, Z, ...)`` may be different from the order of
1711+
the original arguments ``[Y, Z, ...]`` due to type caching.
17091712
For unsupported objects return ``None`` and ``()`` correspondingly.
17101713
Examples::
17111714

0 commit comments

Comments
 (0)