No need to return a bool here

This commit is contained in:
Will McGugan
2023-02-09 09:42:05 +00:00
parent c66c8b6ad6
commit 507a2f8299

View File

@@ -215,7 +215,7 @@ class Reactive(Generic[ReactiveType]):
def invoke_watcher( def invoke_watcher(
watch_function: Callable, old_value: object, value: object watch_function: Callable, old_value: object, value: object
) -> bool: ) -> None:
"""Invoke a watch function. """Invoke a watch function.
Args: Args:
@@ -223,8 +223,6 @@ class Reactive(Generic[ReactiveType]):
old_value: The old value of the attribute. old_value: The old value of the attribute.
value: The new value of the attribute. value: The new value of the attribute.
Returns:
True if the watcher was run, or False if it was posted.
""" """
_rich_traceback_omit = True _rich_traceback_omit = True
param_count = count_parameters(watch_function) param_count = count_parameters(watch_function)
@@ -241,9 +239,6 @@ class Reactive(Generic[ReactiveType]):
sender=obj, callback=partial(await_watcher, watch_result) sender=obj, callback=partial(await_watcher, watch_result)
) )
) )
return False
else:
return True
watch_function = getattr(obj, f"watch_{name}", None) watch_function = getattr(obj, f"watch_{name}", None)
if callable(watch_function): if callable(watch_function):