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

[DRAFT] Py Adapter with NodeVisitor #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

MSarfraz-CR
Copy link
Contributor

No description provided.


from os import environ
class PythonAdapterFactory:
PY_ADAPTER_LATEST_ENV_VAR = "PY_ADAPTER_LATEST"
Copy link
Owner

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):
Copy link
Owner

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):
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants