I don't think so, because it is not 'leaked out of the function', and therefore no objects need a reference to this function to be pickled.