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

Add missing slots to base classes #204

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

ariebovenberg
Copy link
Contributor

The effectiveness of __slots__ is reduced if they are missing in base classes. This was the case for a few classes in parso:

$ slotscheck parso
ERROR: 'parso.python.tree:Keyword' has slots but superclass does not.
ERROR: 'parso.python.tree:Lambda' has slots but superclass does not.
ERROR: 'parso.python.tree:Operator' has slots but superclass does not.
Oh no, found some problems!
Scanned 21 module(s), 136 class(es).

The fix appears easy. All tests seem to pass.

I discovered the slots issues with slotscheck, a tool I maintain. Of course, If you like, I can add it to CI as I've done for instagram/LibCST, sqlalchemy/sqlalchemy, and aio-libs/aiohttp.

@ariebovenberg
Copy link
Contributor Author

Fixed flake8 issue

@davidhalter davidhalter merged commit 8ee84d0 into davidhalter:master Feb 14, 2022
@davidhalter
Copy link
Owner

Thanks a lot @ariebovenberg!

@ariebovenberg ariebovenberg deleted the fix-slots branch February 15, 2022 05:10
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