Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
  • Loading branch information
Dominik1123 authored and miss-islington committed Nov 16, 2020
commit 4edf5785065ca1dd6331fcb3dd74abd3282bf44d
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