What is the intended input type of `expr`?  Can we specialize this function a bit more?  The name of the function determines what types are directed to it.  If this function is for objects of type Relation then this function should be renamed `def Relation`.  

Obviously this was here when you arrived; you might just be the most knowledgable person about this code at the moment though.  Anything you can do here would be appreciated.