tensorbay.utility.deprecated#

Basic concepts of related deprecated functions.

class tensorbay.utility.deprecated.Deprecated(*, since, removed_in=None, substitute=None)[source]#

Bases: object

A decorator for deprecated functions.

Parameters
  • since (str) – The version the function is deprecated.

  • removed_in (Optional[str]) – The version the function will be removed in.

  • substitute (Union[None, str, Callable[[...], Any]]) – The substitute function.

Return type

None

class tensorbay.utility.deprecated.KwargsDeprecated(keywords, *, since, removed_in=None, substitute=None)[source]#

Bases: object

A decorator for the function which has deprecated keyword arguments.

Parameters
  • keywords (Tuple[str, ...]) – The keyword arguments which need to be deprecated.

  • since (str) – The version the keyword arguments are deprecated.

  • remove_in – The version the keyword arguments will be removed in.

  • substitute (Optional[str]) – The substitute usage.

  • removed_in (Optional[str]) –

Return type

None

class tensorbay.utility.deprecated.DefaultValueDeprecated(keyword, *, since, removed_in=None)[source]#

Bases: object

A decorator for the function which has deprecated argument default value.

Parameters
  • keyword (str) – The argument keyword whose default value needs to be deprecated.

  • since (str) – The version the keyword arguments are deprecated.

  • remove_in – The version the keyword arguments will be removed in.

  • removed_in (Optional[str]) –

Return type

None

class tensorbay.utility.deprecated.Disable(*, since, enabled_in, reason)[source]#

Bases: object

A decorator for the function which is disabled temporarily.

Parameters
  • since (str) – The version the function is disabled temporarily.

  • enabled_in (Optional[str]) – The version the function will be enabled again.

  • reason (Optional[str]) – The reason that the function is disabled temporarily.

Return type

None