This is commonly passed in already by `.self_group()` calls where
`against` defaults to `None`.
Handle `against is None` explicitly as the standard type stubs only
accepts the key type for the second argument to `dict.get()`.
}
-def is_precedent(operator: OperatorType, against: OperatorType) -> bool:
+def is_precedent(
+ operator: OperatorType, against: Optional[OperatorType]
+) -> bool:
if operator is against and is_natural_self_precedent(operator):
return False
+ elif against is None:
+ return True
else:
return bool(
_PRECEDENCE.get(