docstrings and type checking