comparison tests/test_ini.txt @ 38:f6616a5f468f

test fibonacci sequence
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 07 Jun 2011 19:17:21 -0700
parents a9eaf65d82c6
children f724db086125
comparison
equal deleted inserted replaced
37:5268ab85fe1b 38:f6616a5f468f
22 You can also just load the callback:: 22 You can also just load the callback::
23 23
24 >>> callback = inifactory.load('callback') 24 >>> callback = inifactory.load('callback')
25 >>> callback('foo', 'bar') 25 >>> callback('foo', 'bar')
26 'abfoor' 26 'abfoor'
27
28 Lets test the Fibonnaci sequence::
29
30 >>> fib = inifactory.load('fibonacci')
31 >>> fib(0) == fib(1) == 1
32 True
33 >>> [fib(i) for i in range(5)]
34 [1, 1, 2, 3, 5]