On Mon, 26 Mar 2007 09:13:58 -0600, Matt Garman <[EMAIL PROTECTED]> wrote: >On 3/23/07, Jack Diederich <[EMAIL PROTECTED]> 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.
A new-style class is one which has a type of type instead of ClassType. For example: >>> class notnewstyle: ... pass ... >>> type(notnewstyle) <type 'classobj'> >>> class newstyle(object): ... pass ... >>> type(newstyle) <type 'type'> >>> class alsonewstyle(list): ... pass ... >>> type(alsonewstyle) <type 'type'> >>> 2.3 has new-style classes. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list