How can I use "is" with variables?

Godot Version

4.2.0

Question

So I want to make a function like this:

func does_list_contain_of_type(type) -> bool: 
    return the_list_has_of_type_or_not

something like

for item in list: 
    if item is type: 
        ...

doesn’t work, I cant use “is” with a variable.
item.is_class(type) doesn’t work, because it only detects build in Classes.

is there a version is is_class() that recognizes custom classes or a way to use “is” with variables?
Thanks.

You use is_instance_of