• Guido van Rossum's avatar
    Pickler.save(): Fix for SF bug #494904: Cannot pickle a class with a · f048a8f6
    Guido van Rossum yazdı
    metaclass, reported by Dan Parisien.
    
    Objects that are instances of custom metaclasses, i.e. whose class is
    a subclass of 'type', should be pickled the same as new-style classes
    (objects whose class is 'type').  This can't be done through a
    dispatch table entry, and the __reduce__ trick doesn't work for these,
    since it finds the unbound __reduce__ for instances of the class
    (inherited from 'object').  So check explicitly using issubclass().
    f048a8f6
pickle.py 26.2 KB