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

Đang mở
#333 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, python
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
0
Fork
0
Merge trung bình
7 giờ 42 phút
Pull request đã merge (30 ngày)
111

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của seanb4t/codegraph-go

Tất cả issue của seanb4t/codegraph-go

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.