def coerce_posf(thing):
    if isinstance(thing, tuple):
        return PosF(*thing)
    if isinstance(thing, (int, float)):
        return PosF(thing, thing)
    msg = "Cannot coerce object of type '%s' to a PosF"
    raise ValueError(msg % type(thing).__name__)
Coerce a thing to a PosF.
dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/widgets/popup_view.py/coerce_posf