diff options
author | kj <28750310+Fidget-Spinner@users.noreply.github.com> | 2020-11-09 04:00:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 04:00:13 (GMT) |
commit | 4eb41d055e8307b8206f680287e492a6db068acd (patch) | |
tree | 49f5dd4d1abac0b43945310972a97e0c943d2869 /Misc/NEWS.d/next/Core and Builtins | |
parent | 23831a7a90956e38b7d70304bb6afe30d37936de (diff) | |
download | cpython-4eb41d055e8307b8206f680287e492a6db068acd.zip cpython-4eb41d055e8307b8206f680287e492a6db068acd.tar.gz cpython-4eb41d055e8307b8206f680287e492a6db068acd.tar.bz2 |
bpo-42233: Add union type expression support for GenericAlias and fix de-duplicating of GenericAlias (GH-23077)
Diffstat (limited to 'Misc/NEWS.d/next/Core and Builtins')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2020-11-01-23-34-56.bpo-42233.zOSzja.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-11-01-23-34-56.bpo-42233.zOSzja.rst b/Misc/NEWS.d/next/Core and Builtins/2020-11-01-23-34-56.bpo-42233.zOSzja.rst new file mode 100644 index 0000000..499bb32 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-11-01-23-34-56.bpo-42233.zOSzja.rst @@ -0,0 +1,5 @@ +Allow ``GenericAlias`` objects to use :ref:`union type expressions <types-union>`. +This allows expressions like ``list[int] | dict[float, str]`` where previously a +``TypeError`` would have been thrown. This also fixes union type expressions +not de-duplicating ``GenericAlias`` objects. (Contributed by Ken Jin in +:issue:`42233`.) |