Mercurial > hg > pyloader
diff tests/objects.py @ 57:cb1898f8c72a
* illustrate another pattern
* note future of pyloader casting
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 08 Jun 2011 23:45:11 -0700 |
parents | 49f88cde6219 |
children | 2a1648a53857 |
line wrap: on
line diff
--- 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])