PEP 747: TypeExpr: Type Hint for a Type Expression

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 explicit TypeExpr(...) syntax in code using |, like the following:

    if isassignable(x, TypeExpr(int | str)): ...  # TypeExpr(...) required
    

Feedback is welcome.