[Python-Dev] PEP 559 - built-in noop()
Serhiy Storchaka
storchaka at gmail.com
Sat Sep 9 16:26:44 EDT 2017
09.09.17 21:46, Barry Warsaw пише:
> One use case would be for PEP 553, where you could set the breakpoint
> environment variable to the following in order to effectively disable it::
>
> $ setenv PYTHONBREAKPOINT=noop
Are there other use cases? PEP 553 still is not approved, and you could
use other syntax for disabling breakpoint(), e.g. setting
PYTHONBREAKPOINT to an empty value.
It looks to me that in all other cases it can be replaced with `lambda
*args, **kwds: None` (actually the expression can be even simpler in
concrete cases). I can't remember any case when I needed an noop()
function (unlike to an identity() function or null context manager).
More information about the Python-Dev
mailing list