-
Notifications
You must be signed in to change notification settings - Fork 6
Immutable #16
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
Conversation
|
Coverage increased on last push I don't know why coveralls thinks it went down... |
|
Another option would be to just use the generated code as a starting point which we edit from here out. I think this has a couple of advantages. It would simplify the metaclass as it would not longer need to dynamically construct It would make the code more clean because the re-implementations of iter_child_nodes, NodeVisitor, etc... could check The disadvantage would obviously be that it is tied to a specific python version. A final option would be to specialize the generation of |
|
The more I think about the more I think that dynamically generating |
6ecac85 to
bb965e8
Compare
|
Okay I have generating While I think it would be pretty cool to automatically build |
|
Another option is generate a bunch of versions and import the one we want. package structure: ast_tools/immutable_ast/__init__.py: |
|
|
||
| def __eq__(self, other): | ||
| if not isinstance(other, type(self)): | ||
| return NotImplemented |
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.
Could this just be False?
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.
I guess this will try the other way (inverse) which may be okay too, this seems reasonable.
| # s/list/tuple/ | ||
| # | ||
| # The CPython license is very permissive so I am pretty sure this is cool. | ||
| # If it is not Guido please forgive me. |
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.
😂
leonardt
left a comment
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.
LGTM
This is a bit janky I automatically rebuild python ast class tree in an immutable form.
It might be better to run
_generate_immutable_astinsetup.pyinstead of shipping a prebuiltimmutable_ast.py.