Skip to content

Commit

Permalink
gh-98576: Fix types in dataclass.InitVar example (gh-98577)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored Oct 31, 2022
1 parent e98923c commit 880bafc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ value is not provided when creating the class::
@dataclass
class C:
i: int
j: int = None
database: InitVar[DatabaseType] = None
j: int | None = None
database: InitVar[DatabaseType | None] = None

def __post_init__(self, database):
if self.j is None and database is not None:
Expand Down

0 comments on commit 880bafc

Please sign in to comment.