A decorator for docstrings and type checking