def val_or_none_key(getter_fcn):
    """Wraps getter_fcn, returning a key that is a tuple of (0 or 1, val) where
    val=getter_fcn(obj), and the int is 0 if val is None."""
    def result_key_fcn(obj):
        val = getter_fcn(obj)
        n = 0 if val is None else 1
        return n, val
    return result_key_fcn