Passed
Push — dev ( 40dcc8...10ffc2 )
by Konstantinos
01:20
created

green_magic.utils.singleton.ObjectRegistry.__new__()   A

Complexity

Conditions 2

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 2
nop 3
1
from abc import ABC
2
3
__all__ = ['Singleton']
4
5
6
class Singleton(ABC):
7
    _instance = None
8
    def __new__(cls, *args, **kwargs):
9
        if not cls._instance:
10
            cls._instance = super(Singleton, cls).__new__(cls)
11
        return cls._instance
12
13