-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
__slots__ = ()
missing in many base classes?
#1144
Comments
__slots__ == ()
missing in many base classes?__slots__ = ()
missing in many base classes?
Yes, my bad. I forgot that I need empty |
@sobolevn it seems the My suggestion would be to add this property to The other alternatives I can think of to avoid this extra
|
🤔 One other option would be to create a separate Thoughts? |
Or we can create a runtime subclass of a container with this new slot 🤔
This also seems like a good idea. |
I'll try the second approach first, as it should result in 'least surprise' for the user. 🤞 let's see if it works 👀 |
related: #416
It seems an empty
__slots__
is forgotten in most base classes (likeImmutable
,Equable
, etc.), greatly reducing the advantage (i.e. memory savings) of defining__slots__
in their subclasses (e.g.Result
,Maybe
). Unless I'm missing something, this is not intended. In that case I will gladly submit a PR fixing this.Example
Expected behavior of slots classes
The text was updated successfully, but these errors were encountered: