Skip to content

Commit 1907e5a

Browse files
gh-98576: Fix types in dataclass.InitVar example (gh-98577)
(cherry picked from commit 880bafc) Co-authored-by: Shantanu <[email protected]>
1 parent 789d132 commit 1907e5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/dataclasses.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ value is not provided when creating the class::
561561
@dataclass
562562
class C:
563563
i: int
564-
j: int = None
565-
database: InitVar[DatabaseType] = None
564+
j: int | None = None
565+
database: InitVar[DatabaseType | None] = None
566566

567567
def __post_init__(self, database):
568568
if self.j is None and database is not None:

0 commit comments

Comments
 (0)