Skip to content

Add missing slots to base classes - #204

Merged
davidhalter merged 1 commit into
davidhalter:masterfrom
ariebovenberg:fix-slots
Feb 14, 2022
Merged

Add missing slots to base classes#204
davidhalter merged 1 commit into
davidhalter:masterfrom
ariebovenberg:fix-slots

Conversation

@ariebovenberg

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Fixed flake8 issue

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

Copy link
Copy Markdown
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