[Python] Compiler annotations for ownership semantics
I maintainer di solito rispondono entro 1 giorno
@aaronj0 ci sta già lavorando.
Dal 16/3/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- C++
- Stelle
- 3.3k
- Fork
- 1.6k
- Merge medio
- 2g 16h
- PR unite (30g)
- 194
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di root-project/root
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newlineForse già presa @dpiparo l’ha presa 3 giorni fa. Apertabug in:Build System
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
root-project/root#23746 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[tmva][sofie] Inputs of unsupported type (e.g. float16) give code that does not compile instead of an errorForse già presa @lmoneta l’ha presa 12 giorni fa. ApertaAI-Assisted bug in:SOFIE
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
root-project/root#23655 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 71/100
root-project/root#23790 ·
I maintainer di solito rispondono entro 1 giorno
-
bug in:Core Libraries
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
root-project/root#23777 ·
I maintainer di solito rispondono entro 1 giorno
-
`TChain::GetEntries` internal caching ineffective?Forse già presa @pcanal l’ha presa 5 giorni fa. Apertaimprovement in:TTree
root-project/root#23738 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di root-project/root
Issue simili
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Niko1221/Strata#3673 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
bug P4
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
open-astro/AlpacaBridge#1520 ·
I maintainer di solito rispondono entro 1 giorno
-
[Docs] CONTRIBUTING still says FreeType 2.14.3 and TabLabel.h says ImGui 1.92.9b after the bumpsForse già presa @mgradwohl l’ha presa oggi. Apertaagent:WSL documentation LOW
Difficoltà 1/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno