Skip to content

Commit

Permalink
bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254)
Browse files Browse the repository at this point in the history
(cherry picked from commit c3b9592)

Co-authored-by: Dominik1123 <15989985+Dominik1123@users.noreply.github.com>
  • Loading branch information
miss-islington and Dominik1123 committed Nov 16, 2020
1 parent 2837241 commit 2369759
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,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::

Expand Down

0 comments on commit 2369759

Please sign in to comment.