From: Tom Faulkner Date: Wed, 11 Jul 2018 02:39:57 +0000 (-0500) Subject: Dataclasses: Fix example on 30.6.8, add method should receive a list rather than... X-Git-Tag: v3.8.0a1~1387 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da5e9476bbfbe61f7661fd22caba1b675e5b4397;p=python 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. --- diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index b26f6422db..9e3c792fd1 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -532,7 +532,7 @@ Mutable default values class C: x = [] def add(self, element): - self.x += element + self.x.append(element) o1 = C() o2 = C()