mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-98576: Fix types in dataclass.InitVar example (gh-98577)
This commit is contained in:
parent
e98923c0be
commit
880bafc574
1 changed files with 2 additions and 2 deletions
|
@ -578,8 +578,8 @@ value is not provided when creating the class::
|
||||||
@dataclass
|
@dataclass
|
||||||
class C:
|
class C:
|
||||||
i: int
|
i: int
|
||||||
j: int = None
|
j: int | None = None
|
||||||
database: InitVar[DatabaseType] = None
|
database: InitVar[DatabaseType | None] = None
|
||||||
|
|
||||||
def __post_init__(self, database):
|
def __post_init__(self, database):
|
||||||
if self.j is None and database is not None:
|
if self.j is None and database is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue