# HG changeset patch # User Jeff Hammel # Date 1307601911 25200 # Node ID cb1898f8c72a4bfe47269e9171e608bfdc47d60a # Parent ade85970c628275a8b6e45f4f15aca7c412086fe * illustrate another pattern * note future of pyloader casting diff -r ade85970c628 -r cb1898f8c72a tests/objects.py --- a/tests/objects.py Wed Jun 08 23:40:51 2011 -0700 +++ b/tests/objects.py Wed Jun 08 23:45:11 2011 -0700 @@ -24,7 +24,7 @@ class Wrapper(object): def __init__(self, app, **values): self.app = app - self.values = dict([(int(i), j) for i, j in values]) + self.values = dict([(int(i), j) for i, j in values]) # TODO: should be automagically converted ideally via pyloader def __call__(self, *args, **kwargs): retval = self.app(*args, **kwargs) values = {1: 'one', @@ -40,6 +40,7 @@ def fib(n): """return the nth fibonacci term""" + n = int(n) # TODO: should be automagically converted ideally via pyloader sequence = [1,1] while len(sequence) - 1 < n: sequence.append(sequence[len(sequence)-1] + sequence[len(sequence)-2]) diff -r ade85970c628 -r cb1898f8c72a tests/test.ini --- a/tests/test.ini Wed Jun 08 23:40:51 2011 -0700 +++ b/tests/test.ini Wed Jun 08 23:45:11 2011 -0700 @@ -12,4 +12,7 @@ [@:%(here)s/objects.py:wrap] app = %(object)s -[foo:@:fibonacci] \ No newline at end of file +[foo:@:fibonacci] + +[bar:fibonacci] +n=1