[Python-Dev] [Very Long 23kb] List of Patches to Go in 2.0.1

Fredrik Lundh fredrik@effbot.org
Wed, 28 Mar 2001 21:21:46 +0200


> Okay, chalk another one up to ignorance.  Another thought occurred to me
> in the shower, though: would this change the pickle of xrange()?  If yes,
> should pickle changes also be prohibited in bugfix releases (in the PEP)?

from the why-dont-you-just-try-it department:

Python 2.0 (#8, Jan 29 2001, 22:28:01) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import pickle
>>> data = xrange(10)
>>> dir(data)
['tolist']
>>> pickle.dumps(data)
Traceback (most recent call last):
...
pickle.PicklingError: can't pickle 'xrange' object: xrange(10)

Python 2.1b2 (#12, Mar 22 2001, 15:15:01) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import pickle
>>> data = xrange(10)
>>> dir(data)
['start', 'step', 'stop', 'tolist']
>>> pickle.dumps(data)
Traceback (most recent call last):
...
pickle.PicklingError: can't pickle 'xrange' object: xrange(10)

Cheers /F