projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9cffdbf
)
Dataclasses: Fix example on 30.6.8, add method should receive a list rather than...
author
Tom Faulkner
<tomfaulkner@gmail.com>
Wed, 11 Jul 2018 02:39:57 +0000
(21:39 -0500)
committer
Eric V. Smith
<ericvsmith@users.noreply.github.com>
Wed, 11 Jul 2018 02:39:57 +0000
(22:39 -0400)
Change example function to append rather than add lists.
Doc/library/dataclasses.rst
patch
|
blob
|
history
diff --git
a/Doc/library/dataclasses.rst
b/Doc/library/dataclasses.rst
index b26f6422db917aa030012f9b93e11fc23dae63e3..9e3c792fd106c7db25052bd8db711cd49d6ca5bb 100644
(file)
--- 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()