| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 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 |