Skip to content

Commit

Permalink
pythongh-91687: modernize dataclass example typing (pythonGH-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.
(cherry picked from commit 7ef614c)

Co-authored-by: Allan Lago <35788148+alago1@users.noreply.github.com>
  • Loading branch information
alago1 authored and miss-islington committed Apr 24, 2023
1 parent 25406e5 commit f56f910
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 @@ -710,7 +710,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 f56f910

Please sign in to comment.