On 26 March 2018 at 18:35, Roberto Martínez wrote:
> @contextmanager
> def calling(fn, *args, **kwargs):
> try:
> yield
> finally:
> fn(*args, **kwargs)
I'd be more amenable to a proposal along these lines (rather than
adding a parameter to
On Mon, Mar 26, 2018 at 10:35 AM, Roberto Martínez <
robertomartin...@gmail.com> wrote:
> Hi,
>
> sometimes I need to use contextlib.close but over methods with a different
> name, for example stop(), halt(), etc. For those cases I have to write my
> own contextlib.close specialized version with
On 03/26/2018 10:35 AM, Roberto Martínez wrote:
> Hi,
>
> sometimes I need to use contextlib.close but over methods with a different
> name, for example stop(), halt(), etc. For those cases I have to write my
> own contextlib.close specialized version with a hard-coded method name.
>
> I think
Hi,
sometimes I need to use contextlib.close but over methods with a different
name, for example stop(), halt(), etc. For those cases I have to write my
own contextlib.close specialized version with a hard-coded method name.
I think adding a "method" argument to contextlib.close can be very