@classmethod
def register_type_replacement(cls, object_type, replacement_function):
    if ((object_type is type) or (not inspect.isclass(object_type))):
        raise ValueError("refusing to register replacement for a non-type or the type 'type' itself")
    cls.__type_replacements[object_type] = replacement_function
@classmethod
def register_type_replacement(cls, object_type, replacement_function):
    if ((object_type is type) or (not inspect.isclass(object_type))):
        raise ValueError("refusing to register replacement for a non-type or the type 'type' itself")
    cls.__type_replacements[object_type] = replacement_function