module documentation

Helpers related to deprecation of functions, methods, classes, other functionality.

Function became_legacy_20 Undocumented
Function deprecated Decorates a function and issues a deprecation warning on use.
Function deprecated_cls Undocumented
Function deprecated_params Decorates a function to warn on use of certain parameters.
Function moved_20 Undocumented
Function warn_deprecated Undocumented
Function warn_deprecated_limited Issue a deprecation warning with a parameterized string, limiting the number of registrations.
Function _decorate_cls_with_warning Undocumented
Function _decorate_with_warning Wrap a function with a warnings.warn and augmented docstring.
Function _sanitize_restructured_text Undocumented
Function _warn_with_version Undocumented
Type Variable _F Undocumented
Type Variable _T Undocumented
def became_legacy_20(api_name: str, alternative: Optional[str] = None, **kw: Any) -> Callable[[_F], _F]: (source)

Undocumented

def deprecated(version: str, message: Optional[str] = None, add_deprecation_to_docstring: bool = True, warning: Optional[Type[exc.SADeprecationWarning]] = None, enable_warnings: bool = True) -> Callable[[_F], _F]: (source)

Decorates a function and issues a deprecation warning on use. :param version: Issue version in the warning. :param message: If provided, issue message in the warning. A sensible default is used if not provided. :param add_deprecation_to_docstring: Default True. If False, the wrapped function's __doc__ is left as-is. If True, the 'message' is prepended to the docs if provided, or sensible default if message is omitted.

def deprecated_cls(version: str, message: str, constructor: Optional[str] = '__init__') -> Callable[[Type[_T]], Type[_T]]: (source)

Undocumented

def deprecated_params(**specs: Tuple[str, str]) -> Callable[[_F], _F]: (source)

Decorates a function to warn on use of certain parameters. e.g. :: @deprecated_params( weak_identity_map=( "0.7", "the :paramref:`.Session.weak_identity_map parameter " "is deprecated." ) )

def moved_20(message: str, **kw: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: (source)

Undocumented

def warn_deprecated(msg: str, version: str, stacklevel: int = 3, code: Optional[str] = None): (source)

Undocumented

def warn_deprecated_limited(msg: str, args: Sequence[Any], version: str, stacklevel: int = 3, code: Optional[str] = None): (source)

Issue a deprecation warning with a parameterized string, limiting the number of registrations.

def _decorate_cls_with_warning(cls: Type[_T], constructor: Optional[str], wtype: Type[exc.SADeprecationWarning], message: str, version: str, docstring_header: Optional[str] = None) -> Type[_T]: (source)

Undocumented

def _decorate_with_warning(func: _F, wtype: Type[exc.SADeprecationWarning], message: str, version: str, docstring_header: Optional[str] = None, enable_warnings: bool = True) -> _F: (source)

Wrap a function with a warnings.warn and augmented docstring.

def _sanitize_restructured_text(text: str) -> str: (source)

Undocumented

def _warn_with_version(msg: str, version: str, type_: Type[exc.SADeprecationWarning], stacklevel: int, code: Optional[str] = None): (source)

Undocumented

Undocumented

Value
TypeVar('_F',
        bound='Callable[..., Any]')

Undocumented

Value
TypeVar('_T',
        bound=Any)