(self)
| 357 | self.assertEqual(p, 21) |
| 358 | |
| 359 | def test_proxy_matmul(self): |
| 360 | class C: |
| 361 | def __matmul__(self, other): |
| 362 | return 1729 |
| 363 | def __rmatmul__(self, other): |
| 364 | return -163 |
| 365 | def __imatmul__(self, other): |
| 366 | return 561 |
| 367 | o = C() |
| 368 | p = weakref.proxy(o) |
| 369 | self.assertEqual(p @ 5, 1729) |
| 370 | self.assertEqual(5 @ p, -163) |
| 371 | p @= 5 |
| 372 | self.assertEqual(p, 561) |
| 373 | |
| 374 | # The PyWeakref_* C API is documented as allowing either NULL or |
| 375 | # None as the value for the callback, where either means "no |
nothing calls this directly
no test coverage detected