Skip to content

Commit f56f910

Browse files
alago1miss-islington
authored andcommitted
pythongh-91687: modernize dataclass example typing (pythonGH-103773)
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 <35788148+alago1@users.noreply.github.com>
1 parent 25406e5 commit f56f910

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/dataclasses.rst

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

711711
@dataclass
712712
class D:
713-
x: List = []
713+
x: list = [] # This code raises ValueError
714714
def add(self, element):
715715
self.x += element
716716

0 commit comments

Comments
 (0)