CallbackPropertyAlias¶
- class echo.CallbackPropertyAlias(target, deprecated=False, warning=None)[source]¶
Bases:
objectAn alias for a CallbackProperty that redirects access to a target property.
This is useful for renaming callback properties while maintaining backwards compatibility. Optionally emits deprecation warnings when the alias is used.
- Parameters:
- targetstr
The name of the target property to redirect to
- deprecatedbool, optional
If True, emit a deprecation warning when the alias is accessed. Defaults to False (silent alias).
- warningstr, optional
A custom warning message. If not provided, a default message will be generated. Setting this implies
deprecated=True.
Examples
class Foo(HasCallbackProperties): # New property name line_color = CallbackProperty('red') # Silent alias for backwards compatibility linecolor = CallbackPropertyAlias('line_color') # Deprecated alias with warning lc = CallbackPropertyAlias('line_color', deprecated=True)