(f, x)
Create a hashable entity describing the type of f.
Create a hashable entity describing the type of f.
Create a hashable entity describing the type of f .
def _mytype(f, x):
    """ Create a hashable entity describing the type of f. """
    if x not in f.free_symbols:
        return ()
    elif f.is_Function:
        return (type(f),)
    else:
        types = [_mytype(a, x) for a in f.args]
        res = []
        for t in types:
            res += list(t)
        res.sort()
        return tuple(res)
def _mytype ( f , x ) : if x not in f . free_symbols : return ( ) elif f . is_Function : return ( type ( f ) , ) else : types = [ _mytype ( a , x ) for a in f . args ] res = [ ] for t in types : res += list ( t ) res . sort ( ) return tuple ( res )