-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
Integrating main to mypy_symbol_resolve
Hey @mgtm98 @kugesan1105 and @ThakeeNathees , I've played with this pr and its a strong approach though I see there's future work, if we can finalize and clean this up a bit i'd be happy to merge, one thing i'd like to do is not do the monkey patching on static class variables to share information across passes, any info that should be shared across passes should probably be save in the IR itself (ie. the ast). Happy to hop on a call and deep dive this with you guys. |
…jaclang into mypy_symbol_resolve
def process_import(self, node: ast.Module, i: ast.ModulePath) -> None: | ||
"""Process an import.""" | ||
imp_node = i.parent_of_type(ast.Import) | ||
if ( | ||
imp_node.is_py | ||
and not i.sub_module | ||
and not is_standard_lib_module(i.path_str) | ||
): | ||
mod = self.import_py_module(node=i, mod_path=node.loc.mod_path) | ||
if mod: | ||
i.sub_module = mod | ||
i.add_kids_right([mod], pos_update=False) | ||
if settings.py_raise_deep: | ||
self.run_again = True |
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've looked into it and i think the approach shoudl be something like this except that when its a paackage/directory you automatically create import nodes for the relevant modules based on the python raise list
Basically, in teh import_py_module function you only import the module path if its in the list. You should naturally end up keeping the right parent relationship.
Description