islambdamethod()   A
last analyzed

Complexity

Conditions 4

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
c 1
b 0
f 0
dl 0
loc 9
rs 9.2
1
#!/usr/bin/env python
2
import inspect
3
from public import public
4
5
# <unbound method CLS.<lambda>> # python 2
6
# <function CLS.<lambda> at > # python 3
7
8
9
@public
10
def islambdamethod(obj):
11
    if not obj:
12
        return False
13
    if not inspect.ismethod(obj):
14
        return False
15
    if obj.__name__.find('<lambda>') >= 0:
16
        return True  # python3
17
    return False
18