import functools


def check_finite(func):
    """Raises ValueError if the annonated function is called on infinite instance"""
    @functools.wraps(func)
    def wrap(self, *args, **kwargs):
        if self.inf:
            raise ValueError("Invalid Operation on Infinite List!")
        return func(self, *args, **kwargs)
    return wrap