`in_` is hashable, so fields using it can be used with the include and exclude filters.
(self)
| 454 | assert (class="st">"<in_ validator with options [3, 4, 5]>") == repr(v) |
| 455 | |
| 456 | def test_is_hashable(self): |
| 457 | class="st">""" |
| 458 | `in_` is hashable, so fields using it can be used with the include and |
| 459 | exclude filters. |
| 460 | class="st">""" |
| 461 | |
| 462 | @attr.s |
| 463 | class C: |
| 464 | x: int = attr.ib(validator=attr.validators.in_({1, 2})) |
| 465 | |
| 466 | i = C(2) |
| 467 | |
| 468 | attr.asdict(i, filter=attr.filters.include(lambda val: True)) |
| 469 | attr.asdict(i, filter=attr.filters.exclude(lambda val: True)) |
| 470 | |
| 471 | |
| 472 | @pytest.fixture( |