◐ Shell
clean mode source ↗

Message 83550 - Python tracker

I think that trying to emulate all "getattr" details in the middle of 
unpickling (but omiting calls to __getattr__) isn't the right thing to 
do. What if in some cases __getattr__ (or __getattribute__) *does* the 
right thing, but pickle doesn't call it? Other people would be 
rightfully upset.

There should be a warning note about __getattr__ in the pickle 
documentation, and people should be encouraged to write __getattr__ in 
a more robust way, if class instances are meant to be pickled.