Commit da5e9476 authored by Tom Faulkner's avatar Tom Faulkner Committed by Eric V. Smith

Dataclasses: Fix example on 30.6.8, add method should receive a list rather...

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.
parent 9cffdbff
...@@ -532,7 +532,7 @@ Mutable default values ...@@ -532,7 +532,7 @@ Mutable default values
class C: class C:
x = [] x = []
def add(self, element): def add(self, element):
self.x += element self.x.append(element)
o1 = C() o1 = C()
o2 = C() o2 = C()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment