summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2022-01-24 15:42:54 (GMT)
committerGitHub <noreply@github.com>2022-01-24 15:42:54 (GMT)
commitc144d9363107b50bcb0ccd01e7202e26a40c21f0 (patch)
treece20e80e4f7164577457d9692d0476af2316d022
parentd7c68639795a576ff58b6479c8bb34c113df3618 (diff)
downloadcpython-c144d9363107b50bcb0ccd01e7202e26a40c21f0.zip
cpython-c144d9363107b50bcb0ccd01e7202e26a40c21f0.tar.gz
cpython-c144d9363107b50bcb0ccd01e7202e26a40c21f0.tar.bz2
bpo-46470: remove unused branch from `typing._remove_dups_flatten` (GH-30780)
The branch was a remnant of old 3.6 typing.Union implementation.
-rw-r--r--Lib/typing.py2
-rw-r--r--Misc/NEWS.d/next/Library/2022-01-22-13-17-35.bpo-46470.MnNhgU.rst1
2 files changed, 1 insertions, 2 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 972b8ba..7ff546f 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 0000000..45b9cea
--- /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``