A decorator for python functions that does type checking.