amiola
amiola

Reputation: 3036

What would be the best option to render typing_extension.Self output type-hint as the class name via mkdocstrings?

I'm looking for advice on how to best render typing_extensions.Self output type-hints, while keeping show_signature_annotations: true option enabled.

mkdocstrings config follows:

plugins:
- mkdocstrings:
    handlers:
       python:
         import:
         - https://installer.readthedocs.io/en/stable/objects.inv
         rendering:
           show_signature_annotations: true
         options:
           members_order: alphabetical

Would it be possible to translate typing_extensions.Self so as that Type is rendered by the class name rather than by the typing_extensions.Self type-hint? IOW,

def func(self, arg: str) -> Self:
    """
    
    Arguments:
        arg: Argument.

    Returns:
        blah blah
    """

would actually output

enter image description here

while I would possibly like Type to output the class name. Alternatively, I would appreciate getting guidance on how to handle such situation; also, does anyone believe - otoh - it is reasonable for it to output Self?

Can anyone advise? Don't know if anyone would consider this a plausible feature request, were this not possible.

Upvotes: 0

Views: 140

Answers (0)

Related Questions