What does unhashable type: 'Individual' mean for decorators

19 views
Skip to first unread message

Bobby Renecker

unread,
Jul 19, 2018, 3:51:00 AM7/19/18
to deap-users
Trying to figure out why I'm getting the TypeError unhashible type: 'Individual' for my decorator function


Here's the code, the line offspring = func(*args, **kargs) is where i'm getting the error

def mate_constraints(protectedList, protectedValues):

    def decorator(func):

        def wrapper(*args, **kargs):

            offspring = func(*args, **kargs)
       
            offspring = handle_mate_constraints(offspring,protectedList, protectedValues);

            return offspring;
                   
            

        return wrapper;

    return decorator;

Reply all
Reply to author
Forward
0 new messages