mirror of https://github.com/python/cpython
gh-91687: modernize dataclass example typing (#103773)
modernize dataclass example typing `list` rather than `List` and comment as to that line being the alluded too error.
This commit is contained in:
parent
3d29edaf0a
commit
7ef614c1ad
|
@ -714,7 +714,7 @@ Using dataclasses, *if* this code was valid::
|
|||
|
||||
@dataclass
|
||||
class D:
|
||||
x: List = []
|
||||
x: list = [] # This code raises ValueError
|
||||
def add(self, element):
|
||||
self.x += element
|
||||
|
||||
|
|
Loading…
Reference in New Issue