]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46470: remove unused branch from `typing._remove_dups_flatten` (GH-30780)
authorNikita Sobolev <mail@sobolevn.me>
Mon, 24 Jan 2022 15:42:54 +0000 (18:42 +0300)
committerGitHub <noreply@github.com>
Mon, 24 Jan 2022 15:42:54 +0000 (23:42 +0800)
The branch was a remnant of old 3.6 typing.Union implementation.

Lib/typing.py
Misc/NEWS.d/next/Library/2022-01-22-13-17-35.bpo-46470.MnNhgU.rst [new file with mode: 0644]

index 972b8ba24b27e83bbd6809ae56777c8aefb6f719..7ff546fbb6492ec96469e06f88296644ea773a86 100644 (file)
@@ -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 (file)
index 0000000..45b9cea
--- /dev/null
@@ -0,0 +1 @@
+Remove unused branch from ``typing._remove_dups_flatten``