예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)