2 ms·
In https://docs.python.org/3.11/whatsnew/3.11.html https://docs.python.org/3.11/whatsnew/3.11.html : > A new function operator.call has been added, such that
by carapace 5y ago
In https://docs.python.org/3.11/whatsnew/3.11.html https://docs.python.org/3.11/whatsnew/3.11.html :
> A new function operator.call has been added, such that
operator.call(obj, *args, **kwargs) == obj(*args, **kwargs).
Isn't this the same as the old apply function?
https://docs.python.org/2/library/functions.html#apply https://docs.python.org/2/library/functions.html#apply
Ah, it was discussed:
https://bugs.python.org/issue44019#msg400821 https://bugs.python.org/issue44019#msg400821
> 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)