[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 7ef614c1ad)

Co-authored-by: Allan Lago <35788148+alago1@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Miss Islington (bot) 2023-04-25 09:16:05 -07:00 committed by GitHub
parent 05a25867ae
commit 026c3e9cc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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