[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-11-18 Thread Guido van Rossum
Guido van Rossum added the comment: Update: I have not forgotten this, but it's a tough case and I haven't made much progress. I don't think I'll make the deadline for 3.5.1. -- assignee: -> gvanrossum ___ Python tracker

[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-11-18 Thread Guido van Rossum
Guido van Rossum added the comment: Actually, I just found an embarrassingly simple fix: diff --git a/src/typing.py b/src/typing.py index d900036..49c4a06 100644 --- a/src/typing.py +++ b/src/typing.py @@ -981,7 +981,7 @@ class GenericMeta(TypingMeta, abc.ABCMeta):

[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-11-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1d37f7dbbb37 by Guido van Rossum in branch '3.5': Issue #25472: In B[], insert B in front of __bases__, to make the __dict__ descriptor work. https://hg.python.org/cpython/rev/1d37f7dbbb37 New changeset 63c261185fc7 by Guido van Rossum in branch

[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-11-18 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for the report! Made it before the 3.5.1 (rc1) deadline. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-10-26 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW the pickle produced looks like this, decoded with pickletools.dis(): 0: \x80 PROTO 3 2: cGLOBAL '__main__ B' 14: qBINPUT 0 16: )EMPTY_TUPLE 17: \x81 NEWOBJ 18: qBINPUT 1 20: }EMPTY_DICT 21: q

[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-10-26 Thread Guido van Rossum
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

[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-10-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Library (Lib) nosy: +alexandre.vassalotti, gvanrossum, pitrou, serhiy.storchaka type: -> behavior versions: +Python 3.6 ___ Python tracker

[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-10-25 Thread Matt Chaput
New submission from Matt Chaput: If I try to pickle and unpickle an object of a class that has specialized a generic superclass, when I try to unpickle I get this error: TypeError: descriptor '__dict__' for 'A' objects doesn't apply to 'B' object Test case: from typing import Generic,