snakelet.storage.annotation.foo()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
from .document import Document
2
3
4
def foo(func):
5
    def inner(*args, **kwargs):
6
        return func(*args, **kwargs)
7
8
    return inner
9
10
11
class Cat(Document):
12
    def __init__(self, name: str, **kwargs):
13
        # Parental
14
        super().__init__(**kwargs)
15
        self.name = name
16
17
    @foo
18
    def meow(self):
19
        return self.name
20
21
22
litter = [
23
    Cat('kitty'),
24
    Cat('cutey')
25
]
26
27
print('meow:', [cat.meow() for cat in litter])
28