(self)
| 9578 | hash(a2) |
| 9579 | |
| 9580 | def test_instantiate(self): |
| 9581 | class C: |
| 9582 | classvar = 4 |
| 9583 | |
| 9584 | def __init__(self, x): |
| 9585 | self.x = x |
| 9586 | |
| 9587 | def __eq__(self, other): |
| 9588 | if not isinstance(other, C): |
| 9589 | return NotImplemented |
| 9590 | return other.x == self.x |
| 9591 | |
| 9592 | A = Annotated[C, "a decoration"] |
| 9593 | a = A(5) |
| 9594 | c = C(5) |
| 9595 | self.assertEqual(a, c) |
| 9596 | self.assertEqual(a.x, c.x) |
| 9597 | self.assertEqual(a.classvar, c.classvar) |
| 9598 | |
| 9599 | def test_instantiate_generic(self): |
| 9600 | MyCount = Annotated[typing.Counter[T], "my decoration"] |
nothing calls this directly
no test coverage detected