Pending removal in Python 3.17
-
Before Python 3.14, old-style unions were implemented using the private class
typing._UnionGenericAlias
. This class is no longer needed for the implementation, but it has been retained for backward compatibility, with removal scheduled for Python 3.17. Users should use documented introspection helpers liketyping.get_origin()
andtyping.get_args()
instead of relying on private implementation details.