summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Faulkner <tomfaulkner@gmail.com>2018-07-11 02:39:57 (GMT)
committerEric V. Smith <ericvsmith@users.noreply.github.com>2018-07-11 02:39:57 (GMT)
commitda5e9476bbfbe61f7661fd22caba1b675e5b4397 (patch)
tree9508fe8a912e9f9762809b05539c50b203662ec8
parent9cffdbffc3b2dec18def1c3e8cfa166d01d609df (diff)
downloadcpython-da5e9476bbfbe61f7661fd22caba1b675e5b4397.zip
cpython-da5e9476bbfbe61f7661fd22caba1b675e5b4397.tar.gz
cpython-da5e9476bbfbe61f7661fd22caba1b675e5b4397.tar.bz2
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.
-rw-r--r--Doc/library/dataclasses.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst
index b26f642..9e3c792 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()