Message400821
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). |
|
| Date |
User |
Action |
Args |
| 2021-09-01 08:03:16 | Antony.Lee | set | recipients:
+ Antony.Lee, brett.cannon, rhettinger, mark.dickinson, vstinner, hrik2001 |
| 2021-09-01 08:03:16 | Antony.Lee | set | messageid: <[email protected]> |
| 2021-09-01 08:03:16 | Antony.Lee | link | issue44019 messages |
| 2021-09-01 08:03:16 | Antony.Lee | create | |
|