feat: a Python class attribute that holds a descriptor from another file becomes an ordinary field

Aperta
#333 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, python
Ambito
backend

Direzione di ricerca

Start in internal/indexer/pyextract/data.go at descriptorClasses (around line 285), which only collects descriptor classes defined in the current file. Read openspec/specs/data-symbols/spec.md near line 92, since it requires descriptors to stay unresolved, and the archived symbol-and-reference-completeness design. Done means choosing one of the two proposed behaviours and showing that a cross-module descriptor attribute no longer resolves to a field, with tests covering that case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:indexer enhancement priority:low spec-needed
What exists today?

Python descriptor detection in the Python extractor: descriptorClasses in internal/indexer/pyextract/data.go (line 285).

How does it behave now?

descriptorClasses finds only the classes in the file being extracted that define __get__, __set__ or __delete__. A class-body attribute bound to an instance of such a class declares no field.

A descriptor class imported from another module is not found. Its attribute is then an ordinary field, and reads through an instance resolve to that field.

docs/LANGUAGE-CAPABILITY-MATRIX.md line 144 documents this for python. The archived design.md for symbol-and-reference-completeness records it as a limit.

How should it behave?

Either option removes the definitive field target for an attribute that the index cannot tie to a descriptor. The first option detects descriptor classes across files, for example by resolving the initializer's class after extraction and checking its members. The second option leaves an attribute bound to an instance of an unresolved class without a definitive field target.

What kind of improvement?

Correctness in an edge case.

Would this change existing behavior?

Yes, for an attribute bound to a descriptor from another module. Its reads no longer resolve to a field that the descriptor replaces.

Before submitting
  • I searched existing issues and this is not a duplicate
  • I checked that the current behavior is not a deliberate decision in openspec/specs/

The last box stays unchecked. openspec/specs/data-symbols/spec.md line 92 requires descriptors to remain unresolved, and this issue asks for a narrower rule for the cross-file case.

Lingua principale
Go
Stelle
0
Fork
0
Merge medio
7h 42m
PR unite (30g)
111

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di seanb4t/codegraph-go

Tutte le issue di seanb4t/codegraph-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.