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

Use .__wrapped__ instead of a .original #436

Closed
wants to merge 4 commits into from

Conversation

Andrew-S-Rosen
Copy link
Member

@Andrew-S-Rosen Andrew-S-Rosen commented Sep 24, 2023

When creating a Job, jobflow checks to see if the function is wrapped by looking for a custom-made .original attribute. This should be the same as the already-created .__wrapped__ attribute from @functools.wraps() so we should just use that.

import jobflow as jf

@jf.job
def add(a, b):
    return a+b

assert add.__wrapped__ == add.original

The above indicates that they are the same.

Sadly, I don't know where I'm going wrong though in this PR :( I'm probably not understanding the logic fully...

@Andrew-S-Rosen Andrew-S-Rosen changed the title [WIP] Use .__wrapped__ instead of a custom .original attribute Sep 24, 2023
@Andrew-S-Rosen Andrew-S-Rosen changed the title Use .__wrapped__ instead of a custom .original attribute Use .__wrapped__ instead of a .original Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant