typish.functions._is_from_typing.is_from_typing()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
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