python icon indicating copy to clipboard operation
python copied to clipboard

Docstring not showing when using the `type` statement.

Open oliversheridanmethven opened this issue 11 months ago • 1 comments

When I use the type statement introduced in Python 3.12, the docstring does not show. However, when I drop this the docstring shows up. Seems like a bug:

foo = list[str]
"""This docstring shows up."""

type bar = list[str]
"""This docstring does not show up."""

oliversheridanmethven avatar Feb 09 '25 08:02 oliversheridanmethven

Hi @oliversheridanmethven, thanks for the report!

It's a feature request rather than a bug (the language evolves and we have to keep up with it) 🙂 Good news, it's almost already supported, see https://github.com/mkdocstrings/griffe/pull/348 and https://github.com/mkdocstrings/python/pull/221.

pawamoy avatar Feb 09 '25 12:02 pawamoy