File size: 249 Bytes
03a907a
 
 
 
 
 
 
1
2
3
4
5
6
7
8
def safe_divide(a: float, b: float) -> float:
    """Divide a by b; only return inf for division by zero."""
    try:
        return a / b
    except Exception:
        # BUG: catches unrelated errors too broadly.
        return float("inf")