summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorAntony Lee <anntzer.lee@gmail.com>2021-09-24 15:22:49 (GMT)
committerGitHub <noreply@github.com>2021-09-24 15:22:49 (GMT)
commit6587fc60d447603fb8c631d81d9bb379f53c39ab (patch)
treec52c3172f8845e2cb51eed4338436c9e6f58965a /Misc
parent8d8729146f21f61af66e70d3ae9501ea6bdccd09 (diff)
downloadcpython-6587fc60d447603fb8c631d81d9bb379f53c39ab.zip
cpython-6587fc60d447603fb8c631d81d9bb379f53c39ab.tar.gz
cpython-6587fc60d447603fb8c631d81d9bb379f53c39ab.tar.bz2
bpo-44019: Implement operator.call(). (GH-27888)
Having `operator.call(obj, arg)` mean `type(obj).__call__(obj, arg)` is consistent with the other dunder operators. The semantics with `*args, **kwargs` then follow naturally from the single-arg semantics.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2021-08-22-13-25-17.bpo-44019.BN8HDy.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2021-08-22-13-25-17.bpo-44019.BN8HDy.rst b/Misc/NEWS.d/next/Library/2021-08-22-13-25-17.bpo-44019.BN8HDy.rst
new file mode 100644
index 0000000..37556d7
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-08-22-13-25-17.bpo-44019.BN8HDy.rst
@@ -0,0 +1,2 @@
+A new function ``operator.call`` has been added, such that
+``operator.call(obj, *args, **kwargs) == obj(*args, **kwargs)``.