(self)
| 9602 | self.assertEqual(MyCount[int]([4, 4, 5]), {4: 2, 5: 1}) |
| 9603 | |
| 9604 | def test_instantiate_immutable(self): |
| 9605 | class C: |
| 9606 | def __setattr__(self, key, value): |
| 9607 | raise Exception("should be ignored") |
| 9608 | |
| 9609 | A = Annotated[C, "a decoration"] |
| 9610 | # gh-115165: This used to cause RuntimeError to be raised |
| 9611 | # when we tried to set `__orig_class__` on the `C` instance |
| 9612 | # returned by the `A()` call |
| 9613 | self.assertIsInstance(A(), C) |
| 9614 | |
| 9615 | def test_cannot_instantiate_forward(self): |
| 9616 | A = Annotated["int", (5, 6)] |
nothing calls this directly
no test coverage detected