Message221898
| Author |
belopolsky |
| Recipients |
ajaksu2, alex, alexandre.vassalotti, bcroq, belopolsky, ddorfman, eltoder, mstefanro, pitrou, rhettinger, zzzeek |
| Date |
2014年06月29日.20:25:16 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1404073517.23.0.205518849328.issue1062277@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Problem "B" has been resolved, but problem "A" is still there.
Python 3.4.1 (default, Jun 29 2014, 15:26:46)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class C:
... def __init__(self, x=None):
... self.x = x if x is not None else self
... def __reduce__(self):
... return C, (self.x,)
...
>>> import pickle
>>> pickle.dumps(C())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion depth exceeded while calling a Python object
>>> c = C([])
>>> c.x.append(c)
>>> c.x[0] is c
True
>>> c2 = pickle.loads(pickle.dumps(c))
>>> c2.x[0] is c2
True |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年06月29日 20:25:17 | belopolsky | set | recipients:
+ belopolsky, rhettinger, ddorfman, pitrou, ajaksu2, alexandre.vassalotti, alex, zzzeek, bcroq, eltoder, mstefanro |
| 2014年06月29日 20:25:17 | belopolsky | set | messageid: <1404073517.23.0.205518849328.issue1062277@psf.upfronthosting.co.za> |
| 2014年06月29日 20:25:17 | belopolsky | link | issue1062277 messages |
| 2014年06月29日 20:25:16 | belopolsky | create |
|