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

オープン
#333 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, python
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
0
フォーク
0
平均マージ
7時間 42分
マージ済み PR(30日)
111

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

seanb4t/codegraph-go のほかの issue

seanb4t/codegraph-go の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。