prefer-set-isdisjoint
Prefer set.isdisjoint when a built-in set intersection is used only as a boolean predicate.
Why
isdisjoint names the overlap predicate directly and avoids allocating an intersection that is immediately discarded.
Fix
Use left.isdisjoint(right) and negate it when the condition requires overlap.
Examples
allowed = {"read", "write"}requested = set(scopes)if not (allowed & requested): deny()allowed = {"read", "write"}requested = set(scopes)if allowed.isdisjoint(requested): deny()