[issue5370] unpickling vs. __getattr__

Mike Meyer report at bugs.python.org
Sat Mar 14 00:30:39 CET 2009


Mike Meyer <mwm at users.sourceforge.net> added the comment:

True. But hat's why it was a QAD hack - all I did was make sure it didn't blow up on the 
test code, and that it passed the provided unit tests.

It really needs to walk the class tree. So something like  hasattr(inst.__class__, 
'__setstate__') is more likely to be correct.

And yes, the pickle unit tests apparently don't test the __*state__ routines, but that's a 
different bug.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5370>
_______________________________________


More information about the Python-bugs-list mailing list