pyecs.helpers.Deprecation#

Functions

deprecated_ecs([reason, use_instead])

ECS-specific deprecation decorator that includes version information.

deprecated_external([reason, use_instead, ...])

Deprecation decorator that only warns for external calls.

warn_deprecated(message[, use_instead, ...])

Issue a deprecation warning for usage patterns that can't be decorated.

Classes

DeprecatedCallable(*args, **kwargs)

Protocol for deprecated callable with custom attributes.

class pyecs.helpers.Deprecation.DeprecatedCallable(*args, **kwargs)[source]#

Protocol for deprecated callable with custom attributes.

__init__(*args, **kwargs)#
pyecs.helpers.Deprecation.deprecated_ecs(reason=None, use_instead=None)[source]#

ECS-specific deprecation decorator that includes version information.

Parameters:
  • reason (str | None) – Optional reason for deprecation

  • use_instead (str | None) – Optional alternative function/method to use

Return type:

Callable[[Callable[[ParamSpec(P)], TypeVar(R)]], Callable[[ParamSpec(P)], TypeVar(R)]]

pyecs.helpers.Deprecation.deprecated_external(reason=None, use_instead=None, allowed_modules=None)[source]#

Deprecation decorator that only warns for external calls.

Parameters:
  • reason (str | None) – Optional reason for deprecation

  • use_instead (str | None) – Optional alternative to suggest

  • allowed_modules (list[str] | None) – List of module names that are allowed to call without warning

Return type:

Callable[[Callable[[ParamSpec(P)], TypeVar(R)]], Callable[[ParamSpec(P)], TypeVar(R)]]

pyecs.helpers.Deprecation.warn_deprecated(message, use_instead=None, stacklevel=3)[source]#

Issue a deprecation warning for usage patterns that can’t be decorated.

Parameters:
  • message (str) – The deprecation message

  • use_instead (str | None) – Optional alternative to suggest

  • stacklevel (int) – Stack level for warning (default 3)

Return type:

None