def test_is_thunk2(self): from __pypy__ import thunk, become, is_thunk def f(): return 42 x = thunk(f) assert is_thunk(x) assert x == 42 assert not is_thunk(x)
def test_is_thunk_become(self): from __pypy__ import thunk, become, is_thunk def f(): return 42 x = thunk(f) y = [] become(y, x) assert is_thunk(y) assert y == 42 assert not is_thunk(y)
def test_is_thunk(self): from __pypy__ import thunk, become, is_thunk def f(): pass assert is_thunk(thunk(f)) assert not is_thunk(42)