From: Python-list <python-list-bounces+jcasale=activenetwerx....@python.org> on behalf of Rob Gaddi <rgaddi@highlandtechnology.invalid> Sent: Thursday, March 15, 2018 12:47 PM To: python-list@python.org Subject: Re: Context manager on method call from class > from contextlib import contextmanager. > > Then you just use the @contextmanager decorator on a function, have it > set up, yield the context you want, and clean up after.
Nice, all of what I wrote replaced with three lines:) Thank you, jlc -- https://mail.python.org/mailman/listinfo/python-list