Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7ef614c

Browse files
authoredApr 24, 2023
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

+1-1
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)
Please sign in to comment.