Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private validate compute #2708

Merged
merged 11 commits into from
Jun 6, 2023
6 changes: 4 additions & 2 deletions src/textual/message_pump.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ def __new__(
)

# Look for reactives with public AND private compute methods.
prefix = "compute_"
prefix_len = len("compute_")
rodrigogiraoserrao marked this conversation as resolved.
Show resolved Hide resolved
for attr_name, value in class_dict.items():
if attr_name.startswith("compute_") and callable(value):
reactive_name = attr_name[len("compute_") :]
if attr_name.startswith(prefix) and callable(value):
reactive_name = attr_name[prefix_len:]
if (
reactive_name in class_dict
and isinstance(class_dict[reactive_name], Reactive)
Expand Down