We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
learning the example patterns/behavioral/memento.py. Transactional is defined as a descriptor, this looks more complicated
Transactional
class Transactional: def __init__(self, method): self.method = method def __get__(self, obj, T): def transaction(*args, **kwargs): state = memento(obj) try: return self.method(obj, *args, **kwargs) except Exception as e: state() raise e return transaction
how about refactor to normal higher-order function?
def Transactional(method): def transaction(obj, *args, **kwargs): state = memento(obj) try: return method(obj, *args, **kwargs) except Exception as e: state() raise e return transaction
The text was updated successfully, but these errors were encountered:
Sure, any simplification is welcome. Feel free to create a pull request
Sorry, something went wrong.
created #408. test passed. could you review?
No branches or pull requests
learning the example patterns/behavioral/memento.py.
Transactional
is defined as a descriptor, this looks more complicatedhow about refactor to normal higher-order function?
The text was updated successfully, but these errors were encountered: