mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
||||
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…
Add table
Add a link
Reference in a new issue