Skip to content

Commit

Permalink
pythongh-91687: modernize dataclass example typing (python#103773)
Browse files Browse the repository at this point in the history
modernize dataclass example typing `list` rather than `List` and comment as to that line being the alluded too error.
  • Loading branch information
alago1 authored Apr 24, 2023
1 parent 3d29eda commit 7ef614c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7ef614c

Please sign in to comment.