How to use the typedload.typechecks.is_literal function in typedload

To help you get started, we’ve selected a few typedload examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ltworf / typedload / tests / test_typechecks.py View on Github external
def test_is_literal(self):
        if sys.version_info.minor >= 8 :
            l = Literal[1, 2, 3]
            assert typechecks.is_literal(l)

        assert not typechecks.is_literal(3)
        assert not typechecks.is_literal(int)
        assert not typechecks.is_literal(str)
        assert not typechecks.is_literal(None)
        assert not typechecks.is_literal(List[int])
github ltworf / typedload / tests / test_typechecks.py View on Github external
def test_is_literal(self):
        if sys.version_info.minor >= 8 :
            l = Literal[1, 2, 3]
            assert typechecks.is_literal(l)

        assert not typechecks.is_literal(3)
        assert not typechecks.is_literal(int)
        assert not typechecks.is_literal(str)
        assert not typechecks.is_literal(None)
        assert not typechecks.is_literal(List[int])
github ltworf / typedload / tests / test_typechecks.py View on Github external
def test_is_literal(self):
        if sys.version_info.minor >= 8 :
            l = Literal[1, 2, 3]
            assert typechecks.is_literal(l)

        assert not typechecks.is_literal(3)
        assert not typechecks.is_literal(int)
        assert not typechecks.is_literal(str)
        assert not typechecks.is_literal(None)
        assert not typechecks.is_literal(List[int])
github ltworf / typedload / tests / test_typechecks.py View on Github external
def test_is_literal(self):
        if sys.version_info.minor >= 8 :
            l = Literal[1, 2, 3]
            assert typechecks.is_literal(l)

        assert not typechecks.is_literal(3)
        assert not typechecks.is_literal(int)
        assert not typechecks.is_literal(str)
        assert not typechecks.is_literal(None)
        assert not typechecks.is_literal(List[int])
github ltworf / typedload / tests / test_typechecks.py View on Github external
def test_is_literal(self):
        if sys.version_info.minor >= 8 :
            l = Literal[1, 2, 3]
            assert typechecks.is_literal(l)

        assert not typechecks.is_literal(3)
        assert not typechecks.is_literal(int)
        assert not typechecks.is_literal(str)
        assert not typechecks.is_literal(None)
        assert not typechecks.is_literal(List[int])