stubgen (stubgenc): Support for tp_getset style C properties
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da mypy.stubgenc.is_c_property e analizza come stubgen riconosce le proprietà e legge i relativi docstrings. Determina in che modo gli attributi C nello stile di tp_getset differiscono dal caso esistente, quindi verifica che i relativi docstrings possano essere utilizzati per inferire i tipi delle proprietà senza influire sugli altri attributi delle estensioni C.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, python
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100