Skip to content

Commit d71453e

Browse files
committed
-
1 parent 18dfbab commit d71453e

File tree

9 files changed

+17
-21
lines changed

9 files changed

+17
-21
lines changed

source_py3/python_toolbox/abc_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class AbstractStaticMethod(staticmethod):
1818
__isabstractmethod__ = True
1919

2020
def __init__(self, function):
21-
super(AbstractStaticMethod, self).__init__(function)
21+
super().__init__(function)
2222
function.__isabstractmethod__ = True

source_py3/python_toolbox/caching/cached_type.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, a, b=2):
4242
'''
4343

4444
def __new__(mcls, *args, **kwargs):
45-
result = super(CachedType, mcls).__new__(mcls, *args, **kwargs)
45+
result = super().__new__(mcls, *args, **kwargs)
4646
result.__cache = {}
4747
return result
4848

@@ -58,5 +58,5 @@ def __call__(cls, *args, **kwargs):
5858
return cls.__cache[sleek_call_args]
5959
except KeyError:
6060
cls.__cache[sleek_call_args] = value = \
61-
super(CachedType, cls).__call__(*args, **kwargs)
61+
super().__call__(*args, **kwargs)
6262
return value

source_py3/python_toolbox/context_management/context_manager_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __new__(mcls, name, bases, namespace):
6666
namespace['__exit__'] = \
6767
ContextManager._ContextManager__exit_using_manage_context
6868

69-
result_class = super(ContextManagerType, mcls).__new__(
69+
result_class = super().__new__(
7070
mcls,
7171
name,
7272
bases,

source_py3/python_toolbox/context_management/context_manager_type_type.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ def MyContextManager():
5353
'__init__': ContextManager.\
5454
_ContextManager__init_lone_manage_context
5555
}
56-
return super(ContextManagerTypeType, cls).__call__(
56+
return super().__call__(
5757
name,
5858
bases,
5959
namespace_dict
6060
)
6161

6262
else:
63-
return super(ContextManagerTypeType, cls).__call__(*args)
63+
return super().__call__(*args)
6464

source_py3/python_toolbox/function_anchoring_type.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ class FunctionAnchoringType(type):
3131
Python learns how to pickle non-module-level functions.
3232
'''
3333
def __new__(mcls, name, bases, namespace_dict):
34-
my_type = super(FunctionAnchoringType, mcls).__new__(mcls,
35-
name,
36-
bases,
37-
namespace_dict)
34+
my_type = super().__new__(mcls, name, bases, namespace_dict)
3835

3936
# We want the type's `vars`, but we want them "getted," and not in a
4037
# `dict`, so we'll get method objects instead of plain functions.

source_py3/python_toolbox/nifty_collections/emitting_weak_key_default_dict.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class EmittingWeakKeyDefaultDict(WeakKeyDefaultDict):
2828
'''
2929

3030
def __init__(self, emitter, *args, **kwargs):
31-
super(EmittingWeakKeyDefaultDict, self).__init__(*args, **kwargs)
31+
super().__init__(*args, **kwargs)
3232
self.emitter = emitter
3333

3434

@@ -38,15 +38,14 @@ def set_emitter(self, emitter):
3838

3939

4040
def __setitem__(self, key, value):
41-
result = \
42-
super(EmittingWeakKeyDefaultDict, self).__setitem__(key, value)
41+
result = super().__setitem__(key, value)
4342
if self.emitter:
4443
self.emitter.emit()
4544
return result
4645

4746

4847
def __delitem__(self, key):
49-
result = super(EmittingWeakKeyDefaultDict, self).__delitem__(key)
48+
result = super().__delitem__(key)
5049
if self.emitter:
5150
self.emitter.emit()
5251
return result
@@ -56,7 +55,7 @@ def pop(self, key, *args):
5655
""" D.pop(k[,d]) -> v, remove specified key and return the
5756
corresponding value. If key is not found, d is returned if given,
5857
otherwise KeyError is raised """
59-
result = super(EmittingWeakKeyDefaultDict, self).pop(key, *args)
58+
result = super().pop(key, *args)
6059
if self.emitter:
6160
self.emitter.emit()
6261
return result
@@ -65,15 +64,15 @@ def pop(self, key, *args):
6564
def popitem(self):
6665
""" D.popitem() -> (k, v), remove and return some (key, value)
6766
pair as a 2-tuple; but raise KeyError if D is empty """
68-
result = super(EmittingWeakKeyDefaultDict, self).popitem()
67+
result = super().popitem()
6968
if self.emitter:
7069
self.emitter.emit()
7170
return result
7271

7372

7473
def clear(self):
7574
""" D.clear() -> None. Remove all items from D. """
76-
result = super(EmittingWeakKeyDefaultDict, self).clear()
75+
result = super().clear()
7776
if self.emitter:
7877
self.emitter.emit()
7978
return result

source_py3/python_toolbox/nifty_collections/weak_key_default_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __repr__(self, recurse=set()):
6868
return "%s(%s, %s)" % (
6969
type_name,
7070
repr(self.default_factory),
71-
super(WeakKeyDefaultDict, self).__repr__()
71+
super().__repr__()
7272
)
7373
finally:
7474
recurse.remove(id(self))

source_py3/python_toolbox/persistent/cross_process_persistent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ def __new__(cls, *args, **kwargs):
8383
thing._CrossProcessPersistent__skip_setstate = True
8484
return thing
8585
else: # This object does not exist in our library yet; let's add it
86-
thing = super(CrossProcessPersistent, cls).__new__(cls)
86+
thing = super().__new__(cls)
8787
thing._CrossProcessPersistent__uuid = received_uuid
8888
library[received_uuid] = thing
8989
return thing
9090

9191
else: # The object is being created
92-
thing = super(CrossProcessPersistent, cls).__new__(cls)
92+
thing = super().__new__(cls)
9393
new_uuid = uuid.uuid4()
9494
thing._CrossProcessPersistent__uuid = new_uuid
9595
library[new_uuid] = thing

source_py3/python_toolbox/sleek_reffing/cute_sleek_value_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def __new__(cls, thing, callback, key):
254254

255255

256256
def __init__(self, thing, callback, key):
257-
super(KeyedSleekRef, self).__init__(thing, callback)
257+
super().__init__(thing, callback)
258258
if self.ref:
259259
self.ref.key = key
260260

0 commit comments

Comments
 (0)