I use the PyCharm IDE which assists with crafting PEP0257-compliant docstrings. It provides two attributes I don't entirely understand the distinction/use between:
:raise Exception: exception explanation here
:raises Exception: exception explanation here
When would I use raise
as opposes to raises
in my docstring? Specifically, if a class required an argument that was not provided and raises a TypeError
, which should be used to document that?