From f922116ac443e3e35c784db29d9da3dbdbedc157 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sat, 22 Jan 2022 13:18:06 +0300 Subject: [PATCH] bpo-46470: remove unused branch from `typing._remove_dups_flatten` --- Lib/typing.py | 2 -- .../next/Library/2022-01-22-13-17-35.bpo-46470.MnNhgU.rst | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2022-01-22-13-17-35.bpo-46470.MnNhgU.rst diff --git a/Lib/typing.py b/Lib/typing.py index 972b8ba24b27e8..7ff546fbb6492e 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -280,8 +280,6 @@ def _remove_dups_flatten(parameters): for p in parameters: if isinstance(p, (_UnionGenericAlias, types.UnionType)): params.extend(p.__args__) - elif isinstance(p, tuple) and len(p) > 0 and p[0] is Union: - params.extend(p[1:]) else: params.append(p) diff --git a/Misc/NEWS.d/next/Library/2022-01-22-13-17-35.bpo-46470.MnNhgU.rst b/Misc/NEWS.d/next/Library/2022-01-22-13-17-35.bpo-46470.MnNhgU.rst new file mode 100644 index 00000000000000..45b9cea3cd56ad --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-01-22-13-17-35.bpo-46470.MnNhgU.rst @@ -0,0 +1 @@ +Remove unused branch from ``typing._remove_dups_flatten``