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

Prevent writing to task results #106

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Conversation

RealOrangeOne
Copy link
Owner

Attributes of a TaskResult should never be updated, since in most cases it doesn't do anything. Making them frozen prevents this, and as a side-benefit allows them to be hashed.

The code which actually does it gets slower, but it prevents a number of potential foot-guns to be worth it. object.__setattr__ is the escape-hatch the docs recommend.

The code which actually does it gets slower, but it prevents a number of potential foot-guns
@RealOrangeOne RealOrangeOne added the tasks-api Issues relating to the tasks API and general API contract from the library label Aug 30, 2024
@RealOrangeOne RealOrangeOne merged commit c7d1e16 into master Aug 30, 2024
41 checks passed
@RealOrangeOne RealOrangeOne deleted the feature/immutable-result branch August 30, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tasks-api Issues relating to the tasks API and general API contract from the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant