# Feature or enhancement ### Proposal: Consider recording `__doc__` on type alias objects. For instance: ```py type Pair[T] = tuple[T, T] """A pair of values of the same type.""" ``` Now `Pair.__doc__` is `"A pair of values of the same type."`. Use it in the REPL: ```pycon >>> from mymodule import Pair >>> help(Pair) Help on type alias Pair in module mymodule: Pair[T] = tuple[T, T] | A pair of values of the same type. | | Attributes: | | __value__ | Lazily evaluated value of the type alias. | | evaluate_value | Evaluation function for __value__. | | __type_params__ | Type parameters declared by the type alias. | | __parameters__ | Type parameters after expansion. | | __name__ | Name of the type alias. | | __qualname__ | Qualified name of the type alias. | | __module__ | Module in which the type alias was defined. ``` (I wrote this text by hand, the actual thing could probably be improved.) I assume IDEs/LSPs already catch it, so this is mainly a runtime feature. Current `help()` just shows a slightly confusing help on the type alias type itself: ```pycon >>> type x = int >>> help(x) Help on TypeAliasType in module __main__ object: x = class TypeAliasType(builtins.object) | Type alias. | | Type aliases are created through the type statement:: | ... ``` It is confusing because (1) it reads like `TypeAliasType` was defined in `__main__` (_Help on TypeAliasType in module `__main__` object_), and (2) almost like if i did `x = typing.TypeAliasType`. (Which could be improved on its own? We could instead say `x = instance of class ...`, not just `x = class ...`) ### Has this already been discussed elsewhere? This is a minor feature, which does not need previous discussion elsewhere ### Links to previous discussion of this feature: _No response_