On 11/06/2016 08:11 PM, Nick Coghlan wrote:
On 7 November 2016 at 12:25, Ethan Furman <et...@stoneleaf.us> wrote:
On 11/06/2016 12:44 AM, Ram Rachum wrote:

I see that Python does allow you to not call `__exit__` if you don't want
  to [...]

Um, how?  I was unaware of this (mis-)feature.

It involves wrapping the context manager in another context manager
that deliberately doesn't delegate the call to __exit__ in some cases
(cf contextlib.ExitStack.pop_all()).

Ah, okay.

Perhaps a custom iterator class would suit Ram's needs better than using a 
generator shortcut.

--
~Ethan~
_______________________________________________
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