def __getstate__(self):
result_dict = {}<EOL>for pickle_attr in self.pickle_attrs:<EOL><INDENT>result_dict[pickle_attr] = self.__dict__[pickle_attr]<EOL><DEDENT>return result_dict<EOL>
Prevent the callback functions from getting pickled