GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 17bacd...7ee669 )
by Benjamin
01:15
created

lazyproperty()   A

Complexity

Conditions 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A _lazyprop() 0 5 2
1
def lazyproperty(fn):
2
    attr_name = '__' + fn.__name__
3
4
    @property
5
    def _lazyprop(self):
6
        if not hasattr(self, attr_name):
7
            setattr(self, attr_name, fn(self))
8
        return getattr(self, attr_name)
9
10
    return _lazyprop
11