Skip to content

Commit 4151e18

Browse files
author
Arjan Egges
committed
Simplified calling singleton super()
1 parent 16e6bf9 commit 4151e18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

10 - object creation/singleton.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Singleton(type):
22
_instances = {}
33
def __call__(cls, *args, **kwargs):
44
if cls not in cls._instances:
5-
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
5+
cls._instances[cls] = super().__call__(*args, **kwargs)
66
return cls._instances[cls]
77

88
class Logger(metaclass=Singleton):

0 commit comments

Comments
 (0)