def get_subclasses(c):
 return (c.__subclasses__() + sum(map(get_subclasses, c.__subclasses__()), []))

def get_subclasses ( c ) : return ( c . __subclasses__ ( ) + sum ( map ( get_subclasses , c . __subclasses__ ( ) ) , [ ] ) )
get all subclasses of a given class .