'Returns a list of archive handlers.
Each handler is a `(path_test, ArchiveClass)` tuple. `path_test`
is a function that returns `True` if the given path can be
handled by `ArchiveClass`. `ArchiveClass` is a class that
implements the same interface as `tarfile.TarFile`.'

@classmethod
def handlers(cls):

    if (not hasattr(cls, '_handlers')):
        cls._handlers = []
        from zipfile import is_zipfile, ZipFile
        cls._handlers.append((is_zipfile, ZipFile))
        from tarfile import is_tarfile, TarFile
        cls._handlers.append((is_tarfile, TarFile))
        try:
            from rarfile import is_rarfile, RarFile
        except ImportError:
            pass
        else:
            cls._handlers.append((is_rarfile, RarFile))
    return cls._handlers
