Add `__slots__` to `arcade.View`
Enhancement request: Add a __slots__ attribute to arcade.View
What should be added/changed?
As talked about in Discord, a __slots__ attribute could be added to arcade.View.
What would it help with?
This will make it easier to specify which attributes belong to a class and should also improve memory performance.
I'm not sure of the value of adding slots to views as it may create problems with mix-ins. It could interfere with possible future work on bringing the UI stack, views, and sections into closer alignment.
I'm not sure of a clear benefit here. Do we have games where there are so many views we need slots?
@Aspect1103 do you have a scenario where this would be helpful?
@Aspect1103 do you have a scenario where this would be helpful?
I thought this was discussed in Discord. It would improve memory performance but would create too many other problems for it to be worth it.
I thought this was discussed in Discord.
I think we need to get better at posting discussion summaries & links back to discord in issues.
It would improve memory performance but would create too many other problems for it to be worth it.
This may be a goal for 3.1 or 4.0, but switching to protocol types for some of our major types may render this a moot issue. It needs further investigation since it comes with downsides such as complicating or eliminating use of isinstance.
Setting this to Future. Looking at the suggeted PR it doesn't seem like this was a good idea after all. Going down the protocol path might be a better way. I don't think we should mess with this before 3.0 release. We are already very late for this release.
See closed pull request