Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-91687: modernize dataclass example typing (GH-103773)
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
commit f56f910d5dd512ec7a2a4d50b90068ce11b05fc7
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