The "include-docstrings" option doesn't work
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
After cloning the latest Mypy version available on GitHub, I see the "include-docstrings" option available, but running stubgen on an extension module that provides docstrings results in no docstrings at all.
To Reproduce
git clone https://github.com/python/mypy.git
python -m build
python -m pip install mypy-1.7.0+dev-py3-none-any.whl
stubgen --include-docstrings -p myextmodule[.pyd]
python -m mypy.stubgen --include-docstrings -p myextmodule[.pyd]
Expected Behavior
The .pyi file generated from stubgen should contain docstrings declared in the extension module, for classes and functions.
Actual Behavior
There is no docstrings at all, but they exist in the extension module. I have confirmed using help(myextmodule).
Your Environment
python 3.11 for Windows x64
myextmodule installed onto site-packages
- Mypy version used: 1.7.0+dev
- Mypy command-line flags: --include-docstrings -p myextmodule
- Mypy configuration options from
mypy.ini(and other config files): - Python version used: cp3.11
I know this is a new feature, but it seems not to work out.
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 den von stubgen --include-docstrings und python -m mypy.stubgen verwendeten stubgen-Einstiegspunkten und reproduziere dann das Verhalten mit einem Erweiterungsmodul unter Python 3.11. Verfolge, wie die Option Klassen und Funktionen behandelt, und überprüfe, dass die generierte .pyi deren vorhandene Docstrings enthält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100