Guido van Rossum added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25472>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to