def ltattr(self, other, *fields, t=None):
    """Allows to avoid repeating implementation of __lt__, where fields of an object are simply compared in order
    Missing fields (None) arbitrarily are considered < all others

    Args:
        self: Object issuing the comparison
        other: Object 'self' is being compared to
        t: If provided, 'other' must be an instance of given type 't'
        *fields: Fields to examine

    Returns:
        (bool): True if there is one field 'x' such that obj1.x < obj2.x, and all previous fields are ==
    """
    if t is not None and not isinstance(other, t):
        return NotImplemented

    for field in fields:
        f1 = getattr(self, field)
        f2 = getattr(other, field)
        if f1 != f2:
            return f1 is None or (f2 is not None and f1 < f2)