-
Notifications
You must be signed in to change notification settings - Fork 3
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
[DRAFT] Py Adapter with NodeVisitor #3
base: main
Are you sure you want to change the base?
Conversation
|
||
from os import environ | ||
class PythonAdapterFactory: | ||
PY_ADAPTER_LATEST_ENV_VAR = "PY_ADAPTER_LATEST" |
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.
The design is very good. The point is that we do no need anymore the old quick and dirty implementation I had done, or do you see any reason to still keep it?
def visit_AnnAssign(self, node: AnnAssign) -> Any: | ||
static_name: str = node.target.id | ||
static_type: str = CommonInfrastructure.NOT_EXTRACTED | ||
if isinstance(node.annotation, ast.Name): |
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 was wondering whether moving check of name in a specific leave of the tree would make sense. What do you think?
# Instance and method vars | ||
method: Datastructure.Method = sub_datastructure.get_method(self.active_method_name_list[-1]) | ||
target = node.target | ||
if isinstance(target, ast.Attribute) or isinstance(target, ast.Name): |
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 was wondering whether moving the check of attribute to a specific leave of the tree would make sense. What do you think?
No description provided.