type_accept decorator deprecated. Would use function annotation but it's not available in python 2.7