Skip to content

Commit 7ef614c

Browse files
authored
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.
1 parent 3d29eda commit 7ef614c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/dataclasses.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ Using dataclasses, *if* this code was valid::
714714

715715
@dataclass
716716
class D:
717-
x: List = []
717+
x: list = [] # This code raises ValueError
718718
def add(self, element):
719719
self.x += element
720720

0 commit comments

Comments
 (0)