[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 in the docs, which warn that "Although powerful, 
implementing __reduce__() directly in your classes is error prone. For this 
reason, class designers should use the high-level interface (i.e., 
__getnewargs__(), __getstate__() and __setstate__()) whenever possible".

--
Added file: http://bugs.python.org/file29513/issue17489_example.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 Apte

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 methods actually needed?

--
components: Library (Lib)
messages: 184721
nosy: mark.dickinson, rhettinger, vterron
priority: normal
severity: normal
status: open
title: random.Random implements __getstate__() and __reduce__()
type: enhancement
versions: Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com