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

Generator store recall #120897

Closed
karanbosamia opened this issue Jun 23, 2024 · 2 comments
Closed

Generator store recall #120897

karanbosamia opened this issue Jun 23, 2024 · 2 comments
Labels
pending The issue will be closed if no feedback is provided type-feature A feature request or enhancement

Comments

@karanbosamia
Copy link

karanbosamia commented Jun 23, 2024

Feature or enhancement

Proposal:

Can a function be inside a class in generator where store_recall method could reinstantiate the object so that it can store the same to the namespace again and the value could be stored at the time of when the instance is called?

# Add a code block here, if required
def __init__(self):
    self.old_value = self.value

def store_recall(self):
    return self.old_value # which is stored in the class at the time of instantiation

Is this possible?

Has this already been discussed elsewhere?

No

Links to previous discussion of this feature:

N/A

@karanbosamia karanbosamia added the type-feature A feature request or enhancement label Jun 23, 2024
@Zheaoli
Copy link
Contributor

Zheaoli commented Jun 23, 2024

Would you mind to share fully demo code or share why the feature is necessary?

@terryjreedy terryjreedy added the pending The issue will be closed if no feedback is provided label Jun 23, 2024
@ronaldoussoren
Copy link
Contributor

This is a question about using Python, that's not what this issue tracker is used for.

Please ask your question at https://discuss.python.org/c/users/7.

@ronaldoussoren ronaldoussoren closed this as not planned Won't fix, can't repro, duplicate, stale Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending The issue will be closed if no feedback is provided type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants