On 6 November 2016 at 17:44, Ram Rachum <r...@rachum.com> wrote:
> I understand your point of view. I see that Python does allow you to not
> call `__exit__` if you don't want to, so I wish it'll have the same approach
> to not calling `generator.close()` if you don't want to. (This is what it's
> really about, not `finally`.)

No, as that's like asking that Python not call close() on files
automatically, or not wait for non-daemon threads to terminate when
it's shutting down.

When Python is discarding a frame that was previously suspended and
never finished normally, it throws an exception into it in order to
give it a chance to release any resources it might be holding. If you
want to deliberately make it leak resources in such cases instead of
cleaning them up, you're going to have to leak them deliberately and
explicitly, just as you would in normal synchronous code.

Regards,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to