Python object overhead?

7stud bbxx789_05ss at yahoo.com
Mon Mar 26 13:35:26 EDT 2007


On Mar 26, 9:13 am, "Matt Garman" <matthew.gar... at gmail.com> wrote:
> On 3/23/07, Jack Diederich <jackd... at jackdied.com> wrote:
>
> > If you make the record a new style class (inherit from object) you can
> > specify the __slots__ attribute on the class.  This eliminates the per
> > instance dictionary overhead in exchange for less flexibility.
>
> When you say "new style class", do you mean that the __slots__ feature
> is only available in a newer version of Python?  Unfortunately, I'm
> stuck on 2.3.4 for this project.
>

__slots__ were made available in 2.2 according to GvR's tutorial here:

http://www.python.org/download/releases/2.2.3/descrintro/




More information about the Python-list mailing list