Hi Trevor, IIRC, yes, and lots. It means you no longer have a __dict__ to work with, which affects @cached_method, pickling, dynamically adding attributes, etc. Not only could using __slots__ in Python classes have far reaching effects within the Sage library, it can affect user's code in the wild. Granted, the latter issue is unlikely to effect the more casual users (and I think happens when we Cythonize something). Subsequently it should be restricted to the places for classes used in tight loops, but then you probably should just fully Cythonize things.
Best, Travis On Tuesday, March 29, 2022 at 5:22:25 AM UTC+9 Trevor Karn wrote: > Hi all, > > I have just learned about using __slots__ for Python classes. It seems > interesting to me and I am excited to see that it seems to be faster and > require less memory. I don't have a specific use case in mind yet, but is > there anything to be careful about in Sage where using __slots__ might > break something? > > Thanks, > Trevor > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/64c20719-be39-4cef-9a51-169171a673ccn%40googlegroups.com.