This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author AlexWaygood
Recipients AlexWaygood, docs@python
Date 2021-10-05.18:29:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1633458543.21.0.19270161871.issue45380@roundup.psfhosted.org>
In-reply-to
Content
`help()` appears confused about the module of `typing.Annotated`. If you call `help()` on a parameterised "instance" of `typing.Annotated`, it will claim that `Annotated` belongs to whatever module the annotated type is from. Additionally, `help()` appears not to know about the `__metadata__` attribute of `typing.Annotated`.

```
>>> from typing import Annotated, Callable
>>> t = Annotated[int | str, "Some metadata"]
>>> help(t)
Help on _AnnotatedAlias in module types:

Annotated = int | str
>>> u = Annotated[Callable[[int], str], "Some metadata"]
>>> help(u)
Help on _AnnotatedAlias in module typing:

Annotated = typing.Callable[[int], str]
>>> s = Annotated[int, "Some metadata"]
Help on _AnnotatedAlias in module builtins:

Annotated = class int(object)
 |  int([x]) -> integer
 |  int(x, base=10) -> integer

# (etc., giving the entire output of help() for `int`)
```
History
Date User Action Args
2021-10-05 18:29:03AlexWaygoodsetrecipients: + AlexWaygood, docs@python
2021-10-05 18:29:03AlexWaygoodsetmessageid: <1633458543.21.0.19270161871.issue45380@roundup.psfhosted.org>
2021-10-05 18:29:03AlexWaygoodlinkissue45380 messages
2021-10-05 18:29:03AlexWaygoodcreate