8000 gh-132139: 3.14 what's new: elaborate on why you can no longer set `U… · python/cpython@42e3a84 · GitHub
[go: up one dir, main page]

Skip to content

Commit 42e3a84

Browse files
authored
gh-132139: 3.14 what's new: elaborate on why you can no longer set Union attributes (#132157)
1 parent f247e1d commit 42e3a84

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,9 @@ typing
11301130
For example, ``isinstance(int | str, typing.Union)`` will return ``True``; previously
11311131
this raised :exc:`TypeError`.
11321132
- The ``__args__`` attribute of :class:`typing.Union` objects is no longer writable.
1133-
- It is no longer possible to set arbitrary dunder attributes on :class:`typing.Union`
1134-
objects.
1133+
- It is no longer possible to set any attributes on :class:`typing.Union` objects.
1134+
This only ever worked for dunder attributes on previous versions, was never
1135+
documented to work, and was subtly broken in many cases.
11351136

11361137
(Contributed by Jelle Zijlstra in :gh:`105499`.)
11371138

0 commit comments

Comments
 (0)
0