Re: With class as contextmanager

2017-01-25 Thread This Wiederkehr
ontext the cleanup of each instance of Klass is called. Regards This 2017-01-25 3:21 GMT+01:00 Terry Reedy : > On 1/24/2017 4:31 PM, This Wiederkehr wrote: > > having a class definition: >> >> class Test(): >> >> @classmethod >> def __enter__(cls): &

With class as contextmanager

2017-01-24 Thread This Wiederkehr
Hellou having a class definition: class Test(): @classmethod def __enter__(cls): pass @classmethod def __exit__(cls, exception_type, execption_value, callback): pass now using this as a contextmanager does not work, even though Test is an object and has the two required methods __enter