Antony Lee <anntzer....@gmail.com> added the comment:

Python2's apply has different semantics: it takes non-unpacked arguments, i.e.

    def apply(f, args, kwargs={}): return f(*args, **kwargs)

rather than

    def call(f, *args, **kwargs): return f(*args, **kwargs)

I agree that both functions can be written in two (or one) line, but the same 
can be said of most functions in the operator module (def add(x, y): return x + 
y); from the module's doc ("efficient functions corresponding to the intrinsic 
operators"), I would argue that the criteria for inclusion are efficiency 
(operator.call is indeed fast, see the linked PR) and intrinsicness (I don't 
know if there's a hard definition, but function calling certainly seems 
intrinsic).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44019>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to