TBranch Get/SetAddress

Is there a way to convert the following code to python?

add = tree.GetBranch("b")->GetAddress() tree.GetBranch("b")->SetAddress((void*)add)

That code can be trivially converted to Python (just change the -> to . and remove the cast), but it won’t do anything useful because Python doesn’t work with pointers. There are ways round that, but it depends what you want to do. See, for example [url=https://root-forum.cern.ch/t/iteration-over-a-tree-in-pyroot-performance-issue/12264/1 post using an array[/url], though that’ll only work for simple types (ints and floats).