from cPickle import dumps class foo(object): def __reduce__(self): raise TypeError, "go away" class MyFloat(float): __slot__ = ('orig') def __new__(cls, orig, value): self = float.__new__(cls, value) self.orig = orig return self __class__ = property(lambda self: self.orig.__class__) f = MyFloat(foo(), 1.0) p = dumps(f) print `p`