8000 bpo-42317: Improve docs of typing.get_args concerning Union · Dominik1123/cpython@5a5ff4d · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a5ff4d

Browse files
author
Dominik1123
committed
bpo-42317: Improve docs of typing.get_args concerning Union
1 parent cc75ab7 commit 5a5ff4d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Doc/library/typing.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,8 @@ 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`, the order of ``(Y, Z, ...)`` may be different
1710+
from the order of the original arguments ``[Y, Z, ...]``.
17091711
For unsupported objects return ``None`` and ``()`` correspondingly.
17101712
Examples::
17111713

0 commit comments

Comments
 (0)
0