'Remove _target before returning object state for pickling.
Thing objects are pickled for caching. The state of the object is
obtained by calling the __getstate__ method. Remove the _target
attribute because it may contain Subreddits or other non-trivial objects
that shouldn\'t be included.'

def __getstate__(self):

    state = self.__dict__
    if ('_target' in state):
        state = {k: v for (k, v) in state.iteritems() if (k != '_target')}
    return state
