[stubgen] infer_sig_from_docstring fails with python3.12 inline generic
Ouverte
Personne n'a encore pris cette issue.
bug
topic-pep-695
topic-stubgen
- Langage dominant
- Python
- Étoiles
- 20.6k
- Forks
- 3.3k
- Merge moyen
- 1 j 18 h
- PR mergées (30 j)
- 54
Description
Bug Report
Trying to infer types from docstrings with python3.12 inline generics fails to generate.
To Reproduce
from mypy.stubdoc import infer_sig_from_docstring
infer_sig_from_docstring('\nfunc[T, V](x: T, y: V) -> T', 'func')
Expected Behavior
infer_sig_from_docstring('\nfunc[T, V](x: T, y: V) -> T', 'func') ==
[
FunctionSig(
name="func", args=[ArgSig(name="x", type="T"), ArgSig(name="y", type="V")], ret_type="T"
)
]
Actual Behavior
infer_sig_from_docstring('\nfunc[T, V](x: T, y: V) -> T', 'func') == []
Your Environment
- Mypy version used: 1.11.dev
- Mypy command-line flags:
- Mypy configuration options from
mypy.ini(and other config files): - Python version used: python 3.10
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez au point d’entrée mypy.stubdoc.infer_sig_from_docstring et reproduisez le problème avec l’appel Python fourni en utilisant une signature générique inline. C’est terminé lorsque l’appel renvoie un FunctionSig pour func avec les arguments x et y et le type de retour T, plutôt qu’une liste vide.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- devtools
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 50/100