From 7692f506e3a6a74228add17b64afc7a46b1a48e1 Mon Sep 17 00:00:00 2001 From: Tom Faulkner Date: Tue, 10 Jul 2018 21:39:57 -0500 Subject: [PATCH] Dataclasses: Fix example on 30.6.8, add method should receive a list rather than an integer. (GH-8038) Change example function to append rather than add lists. (cherry picked from commit da5e9476bbfbe61f7661fd22caba1b675e5b4397) Co-authored-by: Tom Faulkner --- Doc/library/dataclasses.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index 9835c480d0ea55..e9af20a04af167 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -533,7 +533,7 @@ Mutable default values class C: x = [] def add(self, element): - self.x += element + self.x.append(element) o1 = C() o2 = C()