[Python] Compiler annotations for ownership semantics
メンテナーはふだん 1 日以内に返信
@aaronj0 がすでに取り組んでいます。
2026年3月16日 から。
評価
この issue はまだ評価されていません。
説明
Feature description
It would be great if ownership semantics can be communicated in the C++ source code via annotations, so we don't have to write Pythonizations by hand just for this, and carefully keep them in sync with the behavior of the C++ code.
This is relevant for both arguments and return values.
For arguments, we need something to indicate ownership adoption (_transfer_ownership is just a placeholder name to illustrate the idea):
void foo(TObject * _transfer_ownership obj) {
std::unique_ptr<TObject>{obj};
}
For return values, we need something to indicate ownership on the caller side (_caller_owns is again just a placeholder):
TObject *_caller_owns bar() {
return new TObject{};
}
Object ownership problems come up often on the forum (example post), so having a robust way to convey the correct ownership semantics would be a game changer for the robustness of the ROOT Python interfaces.
Alternatives considered
- Manual Pythonizations like in ee79dfd85c2f, but this doesn't scale well.
- Migrating C++ interfaces to smart pointers, but this would break backwards compatibility.
- 主要言語
- C++
- スター
- 3.3k
- フォーク
- 1.6k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 188
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
root-project/root のほかの issue
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newline対応中かも @dpiparo が 4 日前に担当しました。 オープンbug in:Build System
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
root-project/root#23746 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[tmva][sofie] Inputs of unsupported type (e.g. float16) give code that does not compile instead of an error対応中かも @lmoneta が 14 日前に担当しました。 オープンAI-Assisted bug in:SOFIE
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
root-project/root#23655 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[RDataFrame] Code that transforms `#var` alias to `R_rdf_sizeof_var` does not respect string literals対応中かも @vepadulano が 1 日前に担当しました。 オープンbug in:RDataFrame
難易度 3/5 1〜2日 初心者へのやさしさ 71/100
root-project/root#23790 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
TDataMember::GetOffset interfers to TDataMember::GetOffsetCint対応中かも @pcanal が 1 日前に担当しました。 オープンbug in:Core Libraries
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
root-project/root#23777 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`TChain::GetEntries` internal caching ineffective?対応中かも @pcanal が 6 日前に担当しました。 オープンimprovement in:TTree
root-project/root#23738 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
root-project/root の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
telegramdesktop/tdesktop#31505 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
ll-builder shell completions omit existing lockfile commands and --locked対応中かも @project-nju-learner が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
OpenAtom-Linyaps/linyaps#2291 ·
メンテナーはふだん 1 日以内に返信
-
area: ui bug P3: low value: low
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
patrick-hudson/put.gd-desktop#494 ·
メンテナーはふだん 1 日以内に返信