pydoctor icon indicating copy to clipboard operation
pydoctor copied to clipboard

Show Exceptions kind

Open tristanlatr opened this issue 4 years ago • 4 comments

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.

tristanlatr avatar Feb 20 '21 14:02 tristanlatr

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.

mthuurne avatar Mar 02 '21 05:03 mthuurne

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).

mthuurne avatar Mar 02 '21 06:03 mthuurne

I would not bother with code analysis.

As a start, I think that support for "constants" via typing.Final would be a nice feature.

adiroiban avatar Mar 21 '21 21:03 adiroiban

There is an implementation of detecting a exception here https://github.com/tristanlatr/pydocspec/blob/1efc4261a83c306391a97a61112d88b4beef7488/pydocspec/init.py#L650

tristanlatr avatar Dec 16 '21 18:12 tristanlatr