typish.functions._is_from_typing   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A is_from_typing() 0 7 1
1
import typing
2
3
4
def is_from_typing(cls: type) -> bool:
5
    """
6
    Return True if the given class is from the typing module.
7
    :param cls: a type.
8
    :return: True if cls is from typing.
9
    """
10
    return cls.__module__ == typing.__name__
11