mirror of https://github.com/python/cpython
gh-116535: Fix distracting "TypeError" in example code (gh-116538)
This commit is contained in:
parent
1e68c4b876
commit
db8f423f58
|
@ -719,7 +719,7 @@ Using dataclasses, *if* this code was valid::
|
|||
class D:
|
||||
x: list = [] # This code raises ValueError
|
||||
def add(self, element):
|
||||
self.x += element
|
||||
self.x.append(element)
|
||||
|
||||
it would generate code similar to::
|
||||
|
||||
|
@ -728,7 +728,7 @@ it would generate code similar to::
|
|||
def __init__(self, x=x):
|
||||
self.x = x
|
||||
def add(self, element):
|
||||
self.x += element
|
||||
self.x.append(element)
|
||||
|
||||
assert D().x is D().x
|
||||
|
||||
|
|
Loading…
Reference in New Issue