]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-132139: 3.14 what's new: elaborate on why you can no longer set `Union` attributes...
authorAlex Waygood <Alex.Waygood@Gmail.com>
Sun, 6 Apr 2025 15:51:05 +0000 (16:51 +0100)
committerGitHub <noreply@github.com>
Sun, 6 Apr 2025 15:51:05 +0000 (17:51 +0200)
Doc/whatsnew/3.14.rst

index b20d75c11807133c5438872934928c0f2f9ad77b..de76e253eb9264d5b2f27ef6120bd5434c611fa1 100644 (file)
@@ -1130,8 +1130,9 @@ typing
     For example, ``isinstance(int | str, typing.Union)`` will return ``True``; previously
     this raised :exc:`TypeError`.
   - The ``__args__`` attribute of :class:`typing.Union` objects is no longer writable.
-  - It is no longer possible to set arbitrary dunder attributes on :class:`typing.Union`
-    objects.
+  - It is no longer possible to set any attributes on :class:`typing.Union` objects.
+    This only ever worked for dunder attributes on previous versions, was never
+    documented to work, and was subtly broken in many cases.
 
   (Contributed by Jelle Zijlstra in :gh:`105499`.)