def safe_hasattr(item: object, member: str) -> bool:
    """Safe version of ``hasattr()``."""
    try:
        # some sketchy implementation (like paste.registry) of
        # __getattr__ cause hasattr() to throw an error.
        return hasattr(item, member)
    except Exception:
        return False