-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support the match statement #83
Support the match statement #83
Conversation
Ready for a first review. There are probably buggy edge cases |
@@ -56,6 +57,22 @@ def parentFunction(self, node): | |||
def parentStmt(self, node): | |||
return self.parentInstance(node, ast.stmt) | |||
|
|||
_novalue = object() | |||
@contextmanager | |||
def _setattrs(obj, **attrs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better not to use this hack... but it allows to reuse some part of the code without duplicating it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I saw other places where this could be used. So it might simplify other parts as well.
Sorry I messed my PRs because I wanted to merge them into a temporary fork repository (that you can find here: https://github.com/pyforks/beniget-ng). |
Fixes #81