gh-91687: modernize dataclass example typing (#103773)

modernize dataclass example typing `list` rather than `List` and comment as to that line being the alluded too error.
This commit is contained in:
Allan Lago 2023-04-24 11:16:23 -06:00 committed by GitHub
parent 3d29edaf0a
commit 7ef614c1ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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