def is_segment(other):
    """Return true if this is a Segment.

    The purpose of this helper function is for testing if something
    is a segment without requiring the import of the class.
    """
    return getattr(other, "is_segment", False)