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

Move mixins.py to astroid.nodes._base_nodes #1633

Closed
DanielNoord opened this issue Jun 17, 2022 · 0 comments · Fixed by #1635
Closed

Move mixins.py to astroid.nodes._base_nodes #1633

DanielNoord opened this issue Jun 17, 2022 · 0 comments · Fixed by #1635

Comments

@DanielNoord
Copy link
Collaborator

I propose to move mixins.py to astroid.nodes. Specifically to make it a private module within that module.

The most important reason for this is that the Mixin classes in the file are only being used by classes in the nodes module so it makes sense to put them there.

An additional benefit would be that we could change some stuff around to make the inheritance pattern clearer. These Mixins are always mixed with nodes and to help mypy understand them and the astroid code base a little better ideally they should also inherit from NodeNG. This would stop mypy complaining about the usage of methods such as statement() within the methods of the Mixins.

mixins.py isn't included in the __init__.py of astroid and don't provide much use to anybody without actually using the nodes themselves. So I think we can consider this private API.

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

Successfully merging a pull request may close this issue.

1 participant