[issue17489] random.Random implements __getstate__() and __reduce__()

2013-03-19 Thread Víctor Terrón
New submission from Víctor Terrón: The random.Random class implements both the __getstate__() and __reduce__() methods. My knowledge of the pickle module is very limited, but apparently this causes __getstate__() never to get called. Maybe this is a remnant from earlier code, or are both metho

[issue17489] random.Random implements __getstate__() and __reduce__()

2013-03-20 Thread Ramchandra Apte
Ramchandra Apte added the comment: __getstate__ is for pickling instances [0], __reduce__ is for pickling the object itself [1] ^0 http://docs.python.org/2/library/pickle.html#object.__getstate__ ^1 http://docs.python.org/2/library/pickle.html#object.__reduce__ -- nosy: +Ramchandra Apt

[issue17489] random.Random implements __getstate__() and __reduce__()

2013-03-20 Thread Víctor Terrón
Víctor Terrón added the comment: Ramchandra, that is not the behavior that I am able to reproduce. Please see the attached example: in the presence of __reduce__(), __getstate__() is not being called whether the class or an instance its pickled. This is also in consonance with what is stated i

[issue17489] random.Random implements __getstate__() and __reduce__()

2013-03-20 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue17489] random.Random implements __getstate__() and __reduce__()

2013-03-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Possibly __getstate__ could be removed. That said, I would feel a sense of risk in taking it out -- that method has been present for a *very* long time who knows what might rely on it being there. -- priority: normal -> low ___

[issue17489] random.Random implements __getstate__() and __reduce__()

2013-03-23 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[issue17489] random.Random implements __getstate__() and __reduce__()

2013-04-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 68ed5b2ca867 by R David Murray in branch 'default': #17489: Add explanatory comment that __getstate__ is not called. http://hg.python.org/cpython/rev/68ed5b2ca867 -- nosy: +python-dev ___ Python tracker