16 lines
260 B
Python
16 lines
260 B
Python
# mypy: allow-untyped-defs
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
from dataclasses import InitVar
|
|
|
|
|
|
@dataclass
|
|
class Foo:
|
|
init_only: InitVar[int]
|
|
real_attr: int
|
|
|
|
|
|
def test_demonstrate():
|
|
assert Foo(1, 2) == Foo(1, 3)
|