Skip to content

Commit 467985f

Browse files
committed
pythongh-98576: Fix types in dataclass.InitVar example
1 parent 0895c2a commit 467985f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Doc/library/dataclasses.rst‎

Lines changed: 2 additions & 2 deletions
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)