[Python-Dev] PEP 559 - built-in noop()

Chris Angelico rosuav at gmail.com
Sun Sep 10 17:39:07 EDT 2017


On Mon, Sep 11, 2017 at 7:29 AM, Koos Zevenhoven <k7hoven at gmail.com> wrote:
> On Sun, Sep 10, 2017 at 8:21 PM, Barry Warsaw <barry at python.org> wrote:
>>
>> On Sep 9, 2017, at 15:12, Guido van Rossum <guido at python.org> wrote:
>> >
>> > I can't tell whether this was meant seriously, but I don't think it's
>> > worth it. People can easily write their own dummy function and give it any
>> > damn semantics they want. Let's reject the PEP.
>>
>> Alrighty then!  (Yes, it was serious, but I claim post-sprint
>> euphoria/delirium).
>>
>
> Just for future reference, here's a slightly more serious comment:
>
> I think the "pass" statement wasn't mentioned yet, but clearly noop() would
> be duplication of functionality. So maybe the closest thing without
> duplication would be to make "pass" an expression which evaluates to a no-op
> function, but which the compiler could perhaps optimize away if it's a
> statement by itself, or is a builtin.

As a language change, definitely not. But I like this idea for
PYTHONBREAKPOINT. You set it to the name of a function, or to "pass"
if you want nothing to be done. It's a special case that can't
possibly conflict with normal usage.

ChrisA


More information about the Python-Dev mailing list