help(typing.Annotated[foo, ...]) should return the doc for _AnnotatedAlias
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 36k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Split off from #89543; the module issue is fixed but other issues raised in the comments still remain valid. For the following code
>>> from typing import Annotated, Callable
>>> t = Annotated[int | str, "Some metadata"]
>>> help(t)
Help on _AnnotatedAlias in module typing:
Annotated = int | str
We should arguably ignore the instance and return the same thing as help(typing._AnnotatedAlias), analogously to help(int | str) returning the docs for Union
Linked PRs
- gh-97813
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem reproduzierten Verhalten von help(typing.Annotated[...]) und vergleiche es mit help(typing._AnnotatedAlias) und help(int | str). Die Änderung ist abgeschlossen, wenn die Annotated-Instanz die Dokumentation von _AnnotatedAlias statt der aktuellen instancespezifischen Ausgabe zurückgibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- developer-experience
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100