Can't copy iterator object

Kerim Borchaev ( WarKiD ) warkid at
Wed Oct 24 15:21:29 CEST 2001


 I'm not supposed to do so? This could be useful...

Python 2.2b1 (#25, Oct 19 2001, 11:44:52) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> i = iter([1,2,3])
>>> import copy
>>> copy.copy(i)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\Python22\lib\", line 84, in copy
    y = _reconstruct(x, reductor(), 0)
  File "C:\Python22\lib\", line 56, in _reduce
    state = base(self)
TypeError: cannot create 'iterator' instances  

Best regards,
 Kerim                          mailto:warkid at

More information about the Python-list mailing list