(self)
| 2665 | assert called |
| 2666 | |
| 2667 | def test_post_init_not_called_on_copy(self): |
| 2668 | count = 0 |
| 2669 | |
| 2670 | class Ex(Struct): |
| 2671 | def __post_init__(self): |
| 2672 | nonlocal count |
| 2673 | count += 1 |
| 2674 | |
| 2675 | x1 = Ex() |
| 2676 | assert count == 1 |
| 2677 | x2 = x1.__copy__() |
| 2678 | assert x1 == x2 |
| 2679 | assert count == 1 |