()
| 685 | |
| 686 | |
| 687 | def test_callable_obj(): |
| 688 | class Foo: |
| 689 | def __init__(self, a): |
| 690 | self.a = a |
| 691 | |
| 692 | def __call__(self): |
| 693 | return 2 |
| 694 | |
| 695 | foo = Foo(1) |
| 696 | f = delayed(foo) |
| 697 | assert f.compute() is foo |
| 698 | assert f.a.compute() == 1 |
| 699 | assert f().compute() == 2 |
| 700 | |
| 701 | |
| 702 | def identity(x): |