From 59310943becad11f336a3f7e1219b4e93b9ee73f Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 6 May 2024 08:23:09 -0700 Subject: [PATCH] Fix test, add blurb --- Lib/typing.py | 2 +- .../next/Library/2024-05-06-08-23-01.gh-issue-118648.OVA3jJ.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2024-05-06-08-23-01.gh-issue-118648.OVA3jJ.rst diff --git a/Lib/typing.py b/Lib/typing.py index d9e440fe78a27e..dca11cc8c1a8d6 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1328,7 +1328,7 @@ def __getattr__(self, attr): raise AttributeError(attr) def __setattr__(self, attr, val): - if _is_dunder(attr) or attr in {'_name', '_inst', '_nparams'}: + if _is_dunder(attr) or attr in {'_name', '_inst', '_nparams', '_defaults'}: super().__setattr__(attr, val) else: setattr(self.__origin__, attr, val) diff --git a/Misc/NEWS.d/next/Library/2024-05-06-08-23-01.gh-issue-118648.OVA3jJ.rst b/Misc/NEWS.d/next/Library/2024-05-06-08-23-01.gh-issue-118648.OVA3jJ.rst new file mode 100644 index 00000000000000..7695fb0ba20df8 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-05-06-08-23-01.gh-issue-118648.OVA3jJ.rst @@ -0,0 +1,2 @@ +Add type parameter defaults to :class:`typing.Generator` and +:class:`typing.AsyncGenerator`.