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

Abierto
#333 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go, python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
0
Forks
0
Merge medio
7 h 42 min
PR fusionados (30 d)
111

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de seanb4t/codegraph-go

Todos los issues de seanb4t/codegraph-go

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.