Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 da5e947)

Co-authored-by: Tom Faulkner <tomfaulkner@gmail.com>
  • Loading branch information
TomFaulkner authored and miss-islington committed Jul 11, 2018
commit 7692f506e3a6a74228add17b64afc7a46b1a48e1
2 changes: 1 addition & 1 deletion Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down