https://github.com/python/cpython/commit/42e3a8410b7dbc960b3b7c335f2bbb516c8caf6e
commit: 42e3a8410b7dbc960b3b7c335f2bbb516c8caf6e
branch: main
author: Alex Waygood <[email protected]>
committer: ambv <[email protected]>
date: 2025-04-06T17:51:05+02:00
summary:
gh-132139: 3.14 what's new: elaborate on why you can no longer set `Union`
attributes (#132157)
files:
M Doc/whatsnew/3.14.rst
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index b20d75c1180713..de76e253eb9264 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -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`.)
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]