From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 25 Apr 2023 16:16:05 +0000 (-0700) Subject: [3.11] gh-91687: modernize dataclass example typing (GH-103773) (#103774) X-Git-Tag: v3.11.4~165 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=026c3e9cc466a4b7157fc337bf6800a4d144c3ac;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-91687: modernize dataclass example typing (GH-103773) (#103774) modernize dataclass example typing `list` rather than `List` and comment as to that line being the alluded too error. (cherry picked from commit 7ef614c1adad2b8857442bf0fea649891b591109) Co-authored-by: Allan Lago <35788148+alago1@users.noreply.github.com> Co-authored-by: Ɓukasz Langa --- diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index 0a34b996181d..58bf96bf4f06 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -712,7 +712,7 @@ Using dataclasses, *if* this code was valid:: @dataclass class D: - x: List = [] + x: list = [] # This code raises ValueError def add(self, element): self.x += element