File: _is_from_typing.py

package info (click to toggle)
python-typish 1.9.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 332 kB
  • sloc: python: 1,636; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 243 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
import typing


def is_from_typing(cls: type) -> bool:
    """
    Return True if the given class is from the typing module.
    :param cls: a type.
    :return: True if cls is from typing.
    """
    return cls.__module__ == typing.__name__