def objects(self, cls=None):
        """
        Return an iterater over all objects in this directory which are
        instances of `cls`. By default, iterate over all objects (`cls=None`).

        Parameters
        ----------

        cls : a class, optional (default=None)
            If a class is specified, only iterate over objects that are
            instances of this class.

        Returns
        -------

        A generator over the objects in this directory.

        Examples
        --------

            $ rootpy browse myfile.root

            In [1]: list(f1.objects(R.Directory))
            Out[1]: [Directory('mydirectory')]

        """
        objs = (asrootpy(x.ReadObj(), warn=False)
                for x in self.GetListOfKeys())
        if cls is not None:
            objs = (obj for obj in objs if isinstance(obj, cls))
        return objs