Good point. I would like to kindly retract my suggestion and thank everyone for their input. In implementing further, I realize that the default getstate I want returns {} while the current default getstate used when getstate doesn't exist returns self.__dict__. Therefore I need a superclass anyway. Any comments on my other suggestion to modify __reduce__ so that it takes into account the __getnewargs_ex__ that was added in Python 3.4 would be much appreciated. Best, Neil On Sat, Jun 7, 2014 at 7:09 PM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
Neil Girdhar wrote:
Have you tried implementing getstate and setstate with cooperatively inherited classes? You'll need to call super().__getstate__(), which won't exist, but it really should.
The same issue exists with *any* method that you use in a cooperative super call. You need to ensure that there is a class at the end of the MRO with a method that terminates the super call chain.
It's obviously infeasible to add all such possible methods to class object. You will have to provide a *very* strong reason why __getstate__ and __setstate__ should be singled out for special treatment in this regard.
-- Greg
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
--
--- You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group. To unsubscribe from this topic, visit https://groups.google.com/d/ topic/python-ideas/QkvOwa1-pHQ/unsubscribe. To unsubscribe from this group and all its topics, send an email to python-ideas+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.