| 1 |
# mypy: allow-untyped-defs |
| 2 |
from __future__ import annotations |
| 3 |
|
| 4 |
from dataclasses import dataclass |
| 5 |
from dataclasses import InitVar |
| 6 |
|
| 7 |
|
| 8 |
@dataclass |
| 9 |
class Foo: |
| 10 |
init_only: InitVar[int] |
| 11 |
real_attr: int |
| 12 |
|
| 13 |
|
| 14 |
def test_demonstrate(): |
| 15 |
assert Foo(1, 2) == Foo(1, 3) |