(
        self, supported_name: str, parse_replacement: Optional[Callable] = None
    )
return wrapper
A decorator that marks a function as available, but also prints a
        deprecation warning. Use like

        @available.deprecated('my_new_method')
        def my_old_method(self, arg):
            args = compatability_shim(arg)
            return self.my_new_method(*args)

        @available.deprecated('my_new_slow_method', lambda *a, **k: (0, ''))
        def my_old_slow_method(self, arg):
            args = compatibility_shim(arg)
            return self.my_new_slow_method(*args)

        To make `adapter.my_old_method` available but also print out a warning
        on use directing users to `my_new_method`.

        The optional parse_replacement, if provided, will provide a parse-time
        replacement for the actual method (see `available.parse`).
A decorator that marks a function as available, but also prints a
        deprecation warning. Use like
A decorator that marks a function as available but also prints a deprecation warning . Use like
def deprecated(
        self, supported_name: str, parse_replacement: Optional[Callable] = None
    ) -> Decorator:
        """A decorator that marks a function as available, but also prints a
        deprecation warning. Use like

        @available.deprecated('my_new_method')
        def my_old_method(self, arg):
            args = compatability_shim(arg)
            return self.my_new_method(*args)

        @available.deprecated('my_new_slow_method', lambda *a, **k: (0, ''))
        def my_old_slow_method(self, arg):
            args = compatibility_shim(arg)
            return self.my_new_slow_method(*args)

        To make `adapter.my_old_method` available but also print out a warning
        on use directing users to `my_new_method`.

        The optional parse_replacement, if provided, will provide a parse-time
        replacement for the actual method (see `available.parse`).
        """
        def wrapper(func):
            func_name = func.__name__
            renamed_method(func_name, supported_name)

            @wraps(func)
            def inner(*args, **kwargs):
                warn('adapter:{}'.format(func_name))
                return func(*args, **kwargs)

            if parse_replacement:
                available_function = self.parse(parse_replacement)
            else:
                available_function = self
            return available_function(inner)
        return wrapper
def deprecated ( self , supported_name : str , parse_replacement : Optional [ Callable ] = None ) -> Decorator : def wrapper ( func ) : func_name = func . __name__ renamed_method ( func_name , supported_name ) @ wraps ( func ) def inner ( * args , * * kwargs ) : warn ( 'adapter:{}' . format ( func_name ) ) return func ( * args , * * kwargs ) if parse_replacement : available_function = self . parse ( parse_replacement ) else : available_function = self return available_function ( inner ) return wrapper