gh-98576: Fix types in dataclass.InitVar example (gh-98577)

This commit is contained in:
Shantanu 2022-10-31 08:02:02 -07:00 committed by GitHub
parent e98923c0be
commit 880bafc574
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: