-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Add an alias ImportFrom.module
and fix other inconsistencies with the ast module
#1338
Comments
Module.module
ImportFrom.module
Commit that last changed this attribute name is: c3a35e5 I'm not sure why |
ImportFrom.module
ImportFrom.module
and other inconsistencies with the python ast
Other inconsistencies: ClassDef.decorators.nodes -> ClassDef.decorator_list |
ImportFrom.module
and other inconsistencies with the python astImportFrom.module
and fix other inconsistencies with the ast module
I think we should introduce aliases to match what the |
That will get confusing quickly. These inconsistencies are just something that accumulates with time. It isn't too difficult to live with. Compared to aliases. Try understanding code that uses both simultaneously. I would be against it. Like I explained elsewhere astroid isn't designed to be a drop-in replacement for the |
I think the readme should be changed, it currently says:
Maybe also I'm misunderstanding the sentence and the compatibility we're talking about here is about different python versions, it should probably be rephrased if that's the intended meaning. |
I think an update to the readme would be helpful. Would you want to provide a PR for that? I think you probably have the most experience about what |
I was expecting my current visitors simply based on the
ast
module to be working seemlessly withastroid
trees, but it turns out some attributes names are not matching the ones in the standrd library.Current behavior
When trying to get
node.module
on a freshastroid.ImportFrom
:Expected behavior
ImportFrom.module
would be an alias toImportFrom.modname
to match standard library names such that less effort is needed to adoptastroid
.Astroid version:
2.9.3
The text was updated successfully, but these errors were encountered: