MCPcopy
hub / github.com/hyperopt/hyperopt / test_recursion

Function test_recursion

hyperopt/pyll/tests/test_base.py:231–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229
230
231def test_recursion():
232 scope.define(
233 Lambda(
234 "Fact",
235 [("x", p0)],
236 expr=scope.switch(p0 > 1, 1, p0 * base.apply("Fact", p0 - 1)),
237 )
238 )
239 print(scope.Fact(3))
240 assert rec_eval(scope.Fact(3)) == 6
241
242
243def test_partial():

Callers

nothing calls this directly

Calls 3

LambdaClass · 0.90
rec_evalFunction · 0.90
defineMethod · 0.80

Tested by

no test coverage detected