@classmethod
def to_int(cls, val):
    """make int from any value, nice error message if not possible"""
    try:
        return int(val, 0)
    except (TypeError, ValueError):
        raise ValueError('invalid integer')
