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: can't pickle slice objects
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: gangesmaster, georg.brandl
Priority: normal Keywords:

Created on 2006-05-12 13:58 by gangesmaster, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg28514 - (view) Author: ganges master (gangesmaster) Date: 2006-05-12 13:58
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
msg28515 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-05-29 14:45
Logged In: YES 
user_id=849994

Duplicate of #1191699.
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43351
2006-05-12 13:58:04gangesmastercreate