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.

Author stevea_zope
Recipients
Date 2005-07-21.22:22:37
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The example below shows that list(f) swallows the
KeyboardInterrupt.

It swallows any other exception too, such as
MemoryError or application-specific ConflictErrors.

I think the "get the length of the object" optimisation
should catch only AttributeError and TypeError.

>>> class F(object):
...     def __iter__(self):
...         yield 23
...     def __len__(self):
...         print "len called.  raising Keyboard
Interrupt."
...         raise KeyboardInterrupt
...
>>> f = F()
>>> list(f)
len called.  raising Keyboard Interrupt.
[23]
History
Date User Action Args
2007-08-23 14:33:14adminlinkissue1242657 messages
2007-08-23 14:33:14admincreate