You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found you use add_slots to add slots to a lot of classes (e.g. libcst._nodes.expression.Annotation). However, it seems __slots__ is not present in many of their base classes (e.g. libcst._nodes.base.CSTNode), meaning the benefits are reduced.
Unless I'm missing something, we should be able to fix this for a free performance boost!
Thanks for checking! Yes, I'd be happy to review a PR :) I wonder if we could build a linter to run automatically as part of CI for this. Maybe something using https://github.com/instagram/fixit ?
Hi! Well, I found these errors because that's exactly what I'm building myself, haha. Found some mistakes in the stdlib even 👀
I'm assuming fixit is a static analysis tool? I've found it's quite challenging to trace inheritance with all the import shenanigans many libraries use. So in the end it's a runtime checker.
I'm assuming fixit is a static analysis tool? I've found it's quite challenging to trace inheritance with all the import shenanigans many libraries use. So in the end it's a runtime checker.
Hmm, fair enough. If you make a pre-commit hook, I'm happy to include that in our dev/CI process after we've fixed all the offending classes listed above.
👋 Hi there!
I found you use
add_slots
to add slots to a lot of classes (e.g.libcst._nodes.expression.Annotation
). However, it seems__slots__
is not present in many of their base classes (e.g.libcst._nodes.base.CSTNode
), meaning the benefits are reduced.Unless I'm missing something, we should be able to fix this for a free performance boost!
If you agree, I'd be happy to submit a PR
edit: a full list of slotless bases:
The text was updated successfully, but these errors were encountered: