from typing import cast


def to(obj, cls):
    """
    The mirror-image of cast. Cast an object to type

    Infixed for the format '-to>>' making the following equivalent
        `cast(str,5.1) == to(5.1,str) == (5.1 -to>> str) == '5.1'`

    While the `-to>>` format looks cool, be careful as subtraction and bitshift operators
    are in the middle of operator precedence. If using the infix, always use parentheses!

    Args:
        obj: An object to be cast
        cls: Type to cast to

    Returns:
        The object cast to the target class

    Raises:
        TypeError: If the class cannot be converted automatically

    Note:
        This function isn't getting auto-doc'd. I'm assuming it's the infix
    """
    return cast(cls,obj)