Add additional check with different type

Add an additional check for the same function with a different
signature, in order to ensure that the cached version isn't
incorrectly picked up.

Also simplify len(list(...)) to len(...)