mirror of https://github.com/python/cpython.git
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:
parent
ca24e496ba
commit
f6f07b252f
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue