-
Notifications
You must be signed in to change notification settings - Fork 185
[Enh]: Consider adding __slots__ #500
Copy link
Copy link
Closed as not planned
Labels
Description
We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below?
n.a.
Please describe the purpose of the new feature or describe the problem to solve.
To keep the overhead introduced by narwhals objects as low as possible (both in memory and access speed), we could consider using __slots__ since:
- we don't have dynamic attributes
- everything falls back to be attribute access and manipulation
If for some use case a library needs to dynamically add attributes to a narwhals object, we can suggest to inherit from the original narwhals implementation.
Suggest a solution if possible.
No response
If you have tried alternatives, please describe them below.
No response
Additional information that may help us understand your needs.
Hard to figure out how to benchmark this
Reactions are currently unavailable