Use the zero argument form of super() in examples for Python3 docs. (GH-22314)
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index d065487..b2eb9ef 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -863,7 +863,7 @@
... def __init__(self, option_strings, dest, nargs=None, **kwargs):
... if nargs is not None:
... raise ValueError("nargs not allowed")
- ... super(FooAction, self).__init__(option_strings, dest, **kwargs)
+ ... super().__init__(option_strings, dest, **kwargs)
... def __call__(self, parser, namespace, values, option_string=None):
... print('%r %r %r' % (namespace, values, option_string))
... setattr(namespace, self.dest, values)
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
index 91edbba..b92f703 100644
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -753,7 +753,7 @@
class Callback(ExitStack):
def __init__(self, callback, /, *args, **kwds):
- super(Callback, self).__init__()
+ super().__init__()
self.callback(callback, *args, **kwds)
def cancel(self):
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index e109b1e..ae4f7bf 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -1926,7 +1926,7 @@
>>> class Worker(Process):
... def __init__(self, q):
... self.q = q
- ... super(Worker, self).__init__()
+ ... super().__init__()
... def run(self):
... self.q.put('local hello')
...
diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst
index e650bb1..24a18c6 100644
--- a/Doc/library/unittest.mock-examples.rst
+++ b/Doc/library/unittest.mock-examples.rst
@@ -893,7 +893,7 @@
... def __call__(self, /, *args, **kwargs):
... args = deepcopy(args)
... kwargs = deepcopy(kwargs)
- ... return super(CopyingMock, self).__call__(*args, **kwargs)
+ ... return super().__call__(*args, **kwargs)
...
>>> c = CopyingMock(return_value=None)
>>> arg = set()
diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst
index d3c3a07..b88543e 100644
--- a/Doc/library/weakref.rst
+++ b/Doc/library/weakref.rst
@@ -382,7 +382,7 @@
class ExtendedRef(weakref.ref):
def __init__(self, ob, callback=None, /, **annotations):
- super(ExtendedRef, self).__init__(ob, callback)
+ super().__init__(ob, callback)
self.__counter = 0
for k, v in annotations.items():
setattr(self, k, v)
@@ -391,7 +391,7 @@
"""Return a pair containing the referent and the number of
times the reference has been called.
"""
- ob = super(ExtendedRef, self).__call__()
+ ob = super().__call__()
if ob is not None:
self.__counter += 1
ob = (ob, self.__counter)