This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Document that highly recursive data cannot be pickled
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, simonb1
Priority: normal Keywords:

Created on 2003-11-10 07:21 by simonb1, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg18951 - (view) Author: Simon David Burton (simonb1) Date: 2003-11-10 07:21
Make a note in section 3.4.14 Python Library Reference
(perhaps a footnote?) that higly recursive data
stuctures cannot be pickled. Setting the stack limit
helps a bit, but does not scale to large networks of data.

eg.

#!/usr/bin/env python

import cPickle as pickle
#import pickle
import os
#sys.setrecursionlimit(4000)

N = 2048
print "building..."
nest = [ [] for i in range(N) ]
for i in range(N):
  for j in range(N):
    nest[i].append( nest[j] )

print "dumping..."
file = open("nest.pkl","wb")
try:
  pickle.dump( nest, file )
except RuntimeError, e:
  print e

msg18952 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-12-26 23:28
Logged In: YES 
user_id=1188172

Added a note to the docs in rev. 41822/41823.
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39527
2003-11-10 07:21:23simonb1create