Return the distance between all dates and 0 if they are different

def _interval(dates):
        """Return the distance between all dates and 0 if they are different"""
        interval = (dates[1] - dates[0]).days
        last = dates[0]
        for dat in dates[1:]:
            if (dat - last).days != interval:
                return 0
            last = dat
        return interval