def class_instance_overload(target):
    """
    Decorator to add an overload for target that applies when the first argument
    is a ClassInstanceType.
    """
    def decorator(func):
        @wraps(func)
        def wrapped(*args, **kwargs):
            if not isinstance(args[0], ClassInstanceType):
                return
            return func(*args, **kwargs)

        if target is not complex:
            # complex ctor needs special treatment as it uses kwargs
            params = list(inspect.signature(wrapped).parameters)
            assert params == _get_args(len(params))
        return overload(target)(wrapped)

    return decorator

    Decorator to add an overload for target that applies when the first argument
    is a ClassInstanceType.
    
numba/experimental/jitclass/overloads.py