Skip to content

Commit f6f07b2

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 ca24e49 commit f6f07b2

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
@@ -578,8 +578,8 @@ value is not provided when creating the class::
578578
@dataclass
579579
class C:
580580
i: int
581-
j: int = None
582-
database: InitVar[DatabaseType] = None
581+
j: int | None = None
582+
database: InitVar[DatabaseType | None] = None
583583

584584
def __post_init__(self, database):
585585
if self.j is None and database is not None:

0 commit comments

Comments
 (0)