On Nov 22, 2017, at 19:32, Victor Stinner <[email protected]> wrote: > > Aha, contextlib.nullcontext() was just added, cool!
So, if I rewrite PEP 559 in terms of decorators it won’t get rejected?
from functools import wraps
def noop(func):
@wraps(func)
def wrapper(*args, **kws):
return None
return wrapper
@noop
def do_something_important(x, y, z):
return blah_blah_blah(x, y, z)
print(do_something_important(1, 2, z=3))
Cheers?
-Barry
signature.asc
Description: Message signed with OpenPGP
_______________________________________________ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
