def test_cache_memoize_typed(cache):
    """
    Test that cache.memoize() can factor in argument types as part of the cache key.
    """

    @cache.memoize()
    def untyped(a):
        return a

    @cache.memoize(typed=True)
    def typed(a):
        return a

    assert untyped(1) is untyped(1.0)
    assert typed(1) is not typed(1.0)

    assert len(cache) == 3

    untyped_keys = [
        key
        for key in cache.keys()
        if key.startswith("{}.{}".format(untyped.__module__, untyped.__name__))
    ]

    typed_keys = [
        key
        for key in cache.keys()
        if key.startswith("{}.{}".format(typed.__module__, typed.__name__))
    ]

    assert len(untyped_keys) == 1
    assert len(typed_keys) == 2