diff --git a/km3io/rootio.py b/km3io/rootio.py index ccabe0d0b5f8f246e939b45484eea081c3db7023..a816ad1198dc23b7d23327b0c22848f2402f4cba 100644 --- a/km3io/rootio.py +++ b/km3io/rootio.py @@ -111,6 +111,10 @@ class EventReader: self.nested_branches = valid_nested_branches self._keys = keys + def __dir__(self): + """Tab completion in IPython""" + return list(self.keys()) + ["header"] + def keys(self): """Returns all accessible branch keys, without the skipped ones.""" return self._keys @@ -320,6 +324,10 @@ class Branch: self._aliases = aliases self._index_chain = index_chain + def __dir__(self): + """Tab completion in IPython""" + return list(self.fields) + def __getattr__(self, attr): if attr not in self._aliases: raise AttributeError(