Python Union type, but both instead of either
SQLAlchemy has a cool feature where I can write an expression, and depending on the input type, the same expression can build a SQL condition, or evaluate to a value. I’m trying to do the same in my code, using functions instead of expressions, but I can’t figure out how to annotate my functions for pypy to correctly check the types.