Richard Oudkerk <shibt...@gmail.com> added the comment:

I realize now that the idea of using object.__reduce__(..., 2) would not really 
work since many exception classes use non-slot descriptors (unless '__slots__' 
attributes were also added as hints of what to serialize).

I think there are two options simple enough to sneak in to 3.3:

(1) The trivial patch of initially setting self->args in __new__().

(2) Georg's idea of additionally setting a __newargs__ attribute in __new__() 
and using it in __reduce__().  However, I would store __newargs__ directly in 
the struct to avoid always triggering creation of a dict for the instance.

----------

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

Reply via email to