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
Merged

Private validate compute #2708

merged 11 commits into from
Jun 6, 2023

Conversation

rodrigogiraoserrao
Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao commented May 31, 2023

Closes #2539.

  • Adds ability to have private validate methods along with public ones.
  • If there are public and private validate methods, the private one runs first.
  • Adds ability to have private compute methods.
  • If there are public and private compute methods, the error TooManyComputesError is raised.

Right now, there is no documentation about private watch/validate/compute methods.
Only docstrings.

Related PRs: #2442
Related issues: #2382

Private validate methods are checked before the public ones.
We do this inside _MessagePumpMeta.__new__ because this runs at 'import time', and thus is essentially the earliest we can figure out if this is not going to work.
Copy link
Contributor

@davep davep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. One very minor suggestion.

src/textual/message_pump.py Outdated Show resolved Hide resolved
src/textual/message_pump.py Outdated Show resolved Hide resolved
@davep davep mentioned this pull request Jun 6, 2023
@rodrigogiraoserrao rodrigogiraoserrao merged commit 0d646dd into main Jun 6, 2023
@rodrigogiraoserrao rodrigogiraoserrao deleted the private-validate-compute branch June 6, 2023 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow private validate and compute methods
3 participants