K
Kirill Simonov
Could someone explain why __reduce__(2) works for files while
__reduce__(1) doesn't?
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/copy_reg.py", line 69, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle file objects(<function __newobj__ at 0xb7e6317c>, (<type 'file'>,), None, None, None)
What is a correct procedure of getting state and restoring Python objects?
__reduce__(1) doesn't?
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/copy_reg.py", line 69, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle file objects(<function __newobj__ at 0xb7e6317c>, (<type 'file'>,), None, None, None)
What is a correct procedure of getting state and restoring Python objects?