pydoctor
pydoctor copied to clipboard
Show Exceptions kind
Exceptions shows up as Class
in the summary list, it should show Exception
instead.
Same goes for the kind
.
Should show exception documentation
in the "class page" instead.
Technically they are classes, but I agree that they're a special category of classes that is worth giving a dedicated kind
.
Perhaps this is a good time to convert kind
from a str
to an Enum
. It has bothered me for some time that something so core to our structure is implemented as a free-form field. Maybe we should go even further and compute kind
in each Documentable
subclass based on other properties of the documented object.
Slightly off-topic, but another thing that bothers me about our current use of kind
is that most module "variables" are actually constants, but listed in the docs as variables. It would be nice if we could express that, for example using typing.Final
, using a docstring field or by code analysis (variable that's assigned only once of an immutable type).
I would not bother with code analysis.
As a start, I think that support for "constants" via typing.Final
would be a nice feature.
There is an implementation of detecting a exception here https://github.com/tristanlatr/pydocspec/blob/1efc4261a83c306391a97a61112d88b4beef7488/pydocspec/init.py#L650