Summary
The special cases added in astral-sh/ruff#21195 are a little too broad. Here's our behaviour on main:
class Foo:
def __ror__(self, other) -> str:
return "foo"
reveal_type(int | Foo()) # `UnionType`, but should be `str`
reveal_type(int | 42) # `UnionType` (and no diagnostic), but this fails at runtime
Version
No response