From: Python-list on
behalf of Rob Gaddi
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
On 03/15/2018 11:17 AM, Joseph L. Casale wrote:
I have a class which implements a context manager, its __init__
has a signature and the __enter__ returns an instance of the
class.
Along with several methods which implement functionality on
the instance, I have one method which itself must open a
I have a class which implements a context manager, its __init__
has a signature and the __enter__ returns an instance of the
class.
Along with several methods which implement functionality on
the instance, I have one method which itself must open a context
manager against a call on an instance att