stubgen (stubgenc): Support for tp_getset style C properties
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Feature
Currently for C extensions, attributes of a C type originating from tp_getset are not recognized as a class property.
It would be nice to still parse the docstring in such cases, to infer types.
Pitch
As far as I understand, this is due to mypy.stubgenc.is_c_property looking for the fget attribute (the tp_getset style attributes dont have such an attribute - at least in my case, python 3.8).
I am not sure how to properly add checks for such a case (is just removing the check hasattr(obj, 'fget') enough?)
Would be glad for any input here (Am I missing something? Is there a good strategy to add support for tp_getset style attributes?). I would offer to implement the feature, if you think this would make sense.
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 bei mypy.stubgenc.is_c_property und untersuche, wie stubgen Eigenschaften erkennt und ihre Docstrings liest. Ermittle, wie sich C-Attribute im Stil von tp_getset vom bestehenden Fall unterscheiden, und überprüfe anschließend, dass ihre Docstrings zur Ableitung von Eigenschaftstypen verwendet werden können, ohne andere Attribute von C-Erweiterungen zu beeinflussen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, python
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100