Skip to content

fix: Improve inventory object types (incorrectly called roles in mkdocstrings) - #340

Open
pawamoy wants to merge 1 commit into
mainfrom
fix/fix-inventory-object-types
Open

fix: Improve inventory object types (incorrectly called roles in mkdocstrings)#340
pawamoy wants to merge 1 commit into
mainfrom
fix/fix-inventory-object-types

Conversation

@pawamoy

@pawamoy pawamoy commented Sep 4, 2026

Copy link
Copy Markdown
Member

Issue-339: #339

For reviewers

  • I did not use AI
  • I used AI and thoroughly reviewed every code/docs change

Description of the change

See #339, Sphinx inventories do not contain "roles" but "object types".

@pawamoy

pawamoy commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

The property one was easy enough, although I'd prefer to use an hypothetical is_property attribute in the Griffe object. The exception one will have to wait as there's no easy way to check that a class inherits (directly or indirectly) from Exception or BaseException. This will need an update in Griffe (adding for example an is_exception property on class objects). The method one was trivial.

I didn't add support for classmethod and staticmethod, seeing how little they are used in the wild anyway.

Finally I kept parameter and typeparameter, although they are invalid, since some Sphinx extensions already take the liberty to use parameter. We're just a bit more consistent now. If this really is problematic (do some inventory loaders enforce valid types?), we can use obj instead, I don't mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant