From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 11 Jul 2018 10:11:11 +0000 (-0700) Subject: Dataclasses: Fix example on 30.6.8, add method should receive a list rather than... X-Git-Tag: v3.7.1rc1~288 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bcea15a6110737aa87147222b108281bcb41866b;p=thirdparty%2FPython%2Fcpython.git Dataclasses: Fix example on 30.6.8, add method should receive a list rather than an integer. (GH-8038) (GH-8237) Change example function to append rather than add lists. (cherry picked from commit da5e9476bbfbe61f7661fd22caba1b675e5b4397) Co-authored-by: Tom Faulkner --- diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index 9835c480d0ea..e9af20a04af1 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()