Exemplo n.º 1
0
def test_pure_tag():

    @pure
    def func(x):
        return x

    assert get_pure_tag(func)
Exemplo n.º 2
0
def is_pure(func):
    pure_tag = get_pure_tag(func)
    if pure_tag is not None:
        return pure_tag

    if func in _BUILTIN_PURE_CALLABLES or func in _KNOWN_SIGNATURES:
        return True

    return False