bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254)

This commit is contained in:
Dominik1123 2020-11-16 02:30:55 +01:00 committed by GitHub
parent a26215db11
commit c3b9592244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1706,6 +1706,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::