About class checking in Processor

In huggingface type is usually checked using strings.
for example, in transformers/src/[transformers/processing_utils.py

proper_class = getattr(transformers_module, class_name)
if not isinstance(arg, proper_class):
    raise ValueError(...)

where transformers_module is something like

spec = importlib.util.spec_from_file_location(
    "transformers", Path(__file__).parent / "__init__.py", submodule_search_locations=[Path(__file__).parent]
)
transformers_module = spec.loader.load_module()

and class_name is a string like “ViltFeatureExtractor”.

Won’t it be much simpler to use class_name as a type variable, so it will look like this?

from . import ViltFeatureExtractor

class_type = ViltFeatureExtractor
if not isinstance(arg, class_type):
    raise ValueError(...)

What is the reason for this choice? Is there any advantage using string to check type? One disadvantage using string is that it is hard to write custom Processor class with custom FeatureExtractor class because FeatureExtractor needs to be in transfomers library.