[ python-Bugs-1487420 ] can't pickle slice objects

SourceForge.net noreply at sourceforge.net
Fri May 12 15:58:05 CEST 2006


Bugs item #1487420, was opened at 2006-05-12 16:58
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1487420&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: ganges master (gangesmaster)
Assigned to: Nobody/Anonymous (nobody)
Summary: can't pickle slice objects

Initial Comment:
for some reason, slices are not-picklable.
i guess someone just forgot to add support 
for those

>>> import pickle
>>> pickle.dumps(slice(1,2,3))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "D:\Python24\Lib\pickle.py", line 1386, in dumps
    Pickler(file, protocol, bin).dump(obj)
  File "D:\Python24\Lib\pickle.py", line 231, in dump
    self.save(obj)
  File "D:\Python24\Lib\pickle.py", line 313, in save
    rv = reduce(self.proto)
  File "D:\Python24\Lib\copy_reg.py", line 69, in
_reduce_ex
    raise TypeError, "can't pickle %s objects" %
base.__name__
TypeError: can't pickle slice objects
>>>

-tomer

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1487420&group_id=5470


More information about the Python-bugs-list mailing list