()
| 182 | |
| 183 | |
| 184 | def test_dispatch_variadic_on_first_argument(): |
| 185 | foo = Dispatch() |
| 186 | foo.register(int, lambda a, b: a + b) |
| 187 | foo.register(float, lambda a, b: a - b) |
| 188 | |
| 189 | assert foo(1, 2) == 3 |
| 190 | assert foo(1.0, 2.0) == -1 |
| 191 | |
| 192 | |
| 193 | def test_dispatch_lazy(): |