Useful? __slots__ for functions

Nick Jacobson nicksjacobson at yahoo.com
Mon May 24 23:55:01 EDT 2004


The __slots__ attribute of new-style classes can reduce memory usage
when there are millions of instantiations of a class.

So would a __slots__ attribute for functions/methods have a similar
benefit?  i.e. could a function using __slots__ use significantly less
memory, and therefore run faster, if called millions of times?

If so, it will hopefully be in a future version of Python.



More information about the Python-list mailing list