Skip to content

Commit

Permalink
[3.11] gh-91687: modernize dataclass example typing (GH-103773) (#103774
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>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
  • Loading branch information
3 people authored Apr 25, 2023
1 parent 05a2586 commit 026c3e9
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 @@ -712,7 +712,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 026c3e9

Please sign in to comment.