\pythondoc TDirectory

It is possible to retrieve the content of a TDirectory object
just like getting items from a Python dictionary.
Moreover, once a subdirectory or object is accessed for the first time,
it is cached for later use.
For example, assuming `d` is a TDirectory instance:
\code{.py}
# Access a subdirectory
d["subdir"]

# We can go further down in the hierarchy of directories
d["subdir"]["subsubdir"]

# Access an object (e.g. a histogram) in the directory
d["obj"]

# ... or in a subdirectory
d["subdir"]["obj"]

# Wrong key: raises KeyError
d["wrongAttr"]
\endcode

Furthermore, TDirectory implements a `WriteObject` Python method which relies
on TDirectory::WriteObjectAny. This method is a no-op for TDirectory objects,
but it is useful for objects of TDirectory subclasses such as TDirectoryFile
and TFile, which inherit it. Please refer to the documentation of those classes
for more information.

\endpythondoc