Closed LivInTheLookingGlass closed 7 years ago
On the face of it this sounds reasonable, though lemme research slots myself just to confirm that this is a good idea.
I can probably get this and #32 merged/released tonight or maybe tomorrow.
Alright, I did some digging and I'm going to close this PR. Like I'm glad you made the suggestion, but because this breaks assignment of arbitrary attrs this would be a breaking change for only slight memory gains.
I'm going to at least wait until someone has a use case where they can show that this makes a difference.
I'll take #32 though.
Okay, fair enough. Thank you for reviewing. I appreciate you taking the time.
On February 7, 2017 9:17:13 PM EST, Joshua Holbrook notifications@github.com wrote:
Alright, I did some digging and I'm going to close this PR. Like I'm glad you made the suggestion, but because this breaks assignment of arbitrary attrs this would be a breaking change for only slight memory gains.
I'm going to at least wait until someone has a use case where they can show that this makes a difference.
I'll take #32 though.
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/jfhbrook/pyee/pull/33#issuecomment-278209118
Yeah no sweat! I like getting code submissions, especially on this project!
Adding
__slots__
allows python to know in advance what attributes your class will have. This means it can specifically allocate only those names. This means access is slightly faster, and you allocate less memory per instance of the objects