python
python copied to clipboard
Docstring not showing when using the `type` statement.
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."""
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.