Nick Coghlan wrote:

I don't see it as an implementation detail - it's part of the spec of
generator finalisation in PEP 342

It doesn't seem like something you need to know in this
situation, though. All it tells you is that the finalisation
is happening because the generator is being closed rather
than completing on its own.

I suppose it doesn't do any harm, but it seems untidy to
clutter up the traceback with irrelevant and possibly
confusing information.

Hit Ctrl-C nowTraceback (most recent call last):
  File "<stdin>", line 2, in <module>
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
RuntimeError: Ooops

That's a bit different, because the fact that the program
was terminated by Ctrl-C could be useful information.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to