Expect the unexpected, but get what you want
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
.travis.yml
LICENSE
MANIFEST.in
README.rst
VERSION.txt
fabfile.py
setup.py

README.rst

Anticipate

Build Status

Expect the unexpected, but get what you want.

@anticipate(int)
def get_int():
  return '1'

assert get_int() == 1

@anticipate(str)
def get_str():
  return 22

assert get_str() == '22'

@anticipate([str])
def get_strs(*args):
  return args

assert list(get_strs(1, 2, 3)) == ['1', '2', '3']

Works much better with your own objects or with SpringField