#๐Ÿ”’ [mkdocstrings] Print type of property?

12 messages ยท Page 1 of 1 (latest)

dapper kindle
#

Why mkdocstrings doesn't print the type of the property?
I have this:

    @property
    @abstractmethod
    def rounding_method(self) -> RoundingMethod:
        """
        The rounding method used to round/floor the PTS (Presentation Time Stamp).
        """
        pass

I get this result:

rounding_method abstractmethod property

The rounding method used to round/floor the PTS (Presentation Time Stamp).

I am expecting the type (RoundingMethod) to be generated somewhere

weary radishBOT
#

@dapper kindle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

old bloom
dapper kindle
#

Strange, I didn't need to do that with sphinx

hollow fossil
#

It looks like it's supposed to be supported:

Support for type annotations: Griffe collects your type annotations and mkdocstrings uses them to display parameter types or return types. It is even able to automatically add cross-references to other objects from your API, from the standard library or third-party libraries! See how to load inventories to enable it.

#

Do you need to add Griffe as a plugin or something?

deft idol
#

sounds like something better discussed with the project maintainers (e.g. make a feature request or bug report with a proper MRE)

dapper kindle
#

I'm just not sure if it is a bug/feature request or if i am doing anything wrong

old bloom
dapper kindle
#

!close

weary radishBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.