I’ve drafted a replacement PR that takes a different approach:
-
No longer attempts to alter the rules for the
|
operator. Thus users must use the explicitTypeExpr(...)
syntax in code using|
, like the following:if isassignable(x, TypeExpr(int | str)): ... # TypeExpr(...) required
Feedback is welcome.