Logo ROOT  
Reference Guide
TDirectoryPyz.cxx File Reference
#include "CPyCppyy.h"
#include "CPPInstance.h"
#include "PyROOTPythonize.h"
#include "ProxyWrappers.h"
#include "Utility.h"
#include "PyzCppHelpers.hxx"
#include "TClass.h"
#include "TDirectory.h"
#include "TKey.h"
#include "Python.h"
Include dependency graph for TDirectoryPyz.cxx:

Functions

PyObjectTDirectoryGetAttr (PyObject *self, PyObject *attr)
 Implements a getter to assign to TDirectory.__getattr__ Method that is assigned to TDirectory.__getattr__. More...
 
PyObjectTDirectoryWriteObject (CPPInstance *self, PyObject *args)
 Implements the WriteObject method of TDirectory This method allows to write objects into TDirectory instances with this syntax: More...
 

Function Documentation

◆ TDirectoryGetAttr()

PyObject * TDirectoryGetAttr ( PyObject self,
PyObject attr 
)

Implements a getter to assign to TDirectory.__getattr__ Method that is assigned to TDirectory.__getattr__.

It relies on Get to obtain the object from the TDirectory and adds on top:

  • Raising an AttributeError if the object does not exist
  • Caching the result of a successful get for future re-attempts. Once cached, the same object is retrieved every time. This pythonisation is inherited by TDirectoryFile and TFile.

Definition at line 68 of file TDirectoryPyz.cxx.

◆ TDirectoryWriteObject()

PyObject * TDirectoryWriteObject ( CPPInstance self,
PyObject args 
)

Implements the WriteObject method of TDirectory This method allows to write objects into TDirectory instances with this syntax:

myDir.WriteObject(myObj, "myKeyName")

Definition at line 32 of file TDirectoryPyz.cxx.