Skip to content

Commit 026c3e9

Browse files
miss-islingtonalago1ambv
authored
[3.11] gh-91687: modernize dataclass example typing (GH-103773) (#103774)
modernize dataclass example typing `list` rather than `List` and comment as to that line being the alluded too error. (cherry picked from commit 7ef614c) Co-authored-by: Allan Lago <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
1 parent 05a2586 commit 026c3e9

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
@@ -712,7 +712,7 @@ Using dataclasses, *if* this code was valid::
712712

713713
@dataclass
714714
class D:
715-
x: List = []
715+
x: list = [] # This code raises ValueError
716716
def add(self, element):
717717
self.x += element
718718

0 commit comments

Comments
 (0)