Message253515
| Author |
gvanrossum |
| Recipients |
alexandre.vassalotti, gvanrossum, maatt, pitrou, serhiy.storchaka |
| Date |
2015年10月27日.04:14:01 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1445919242.48.0.90366175321.issue25472@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The issue seems to be the line
inst_dict = inst.__dict__
in _Unpickler.load_build(). (I found this out by forcing sys.modules['_pickle'] = None, so the pure-Python pickle.py code gets used.)
This leads to a simpler repro:
# Use the same class definitions for A and B
b = B("hello")
print(b.__dict__) # Same error message as before
That is, specialized subclasses of generics don't have a working __dict__ attribute! Interestingly, A("hello").__dict__ works.
I have to ponder this more. |
|