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

(cherry picked from commit 880bafc574)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2022-10-31 08:14:04 -07:00 committed by GitHub
parent ca24e496ba
commit f6f07b252f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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: