Re: [Tutor] Subclassing data attributes

2005-11-04 Thread Jan Eden
Hi Kent, Kent Johnson wrote on 04.11.2005: > >OK I'll try again. I still don't understand why you don't like using >straight class attributes - is it to keep the size of the class >namespace smaller? > Yes, and to distinguish between different kinds of attributes in the main script. In the end, i

Re: [Tutor] Subclassing data attributes

2005-11-04 Thread Kent Johnson
Jan Eden wrote: > Not exactly. My current setup bundles all data attributes in a single > module Data containing a single class for each object. So in my main > module (Show), I define:> > class Page(Data.Page): > ... > > and Data contains: > > class Base: > children = 'xyz' > childr

Re: [Tutor] Subclassing data attributes

2005-11-03 Thread Kent Johnson
Jan Eden wrote: > Hi, > > the module Data.py stores a number of data attributes. I'd like to structure > the storage of these attributes, either in subclasses or in dictionaries. > > My first attempt was this: > > class A: > templates['attr1'] = 'string' > queries['children'] = ... >

[Tutor] Subclassing data attributes

2005-11-03 Thread Jan Eden
Hi, the module Data.py stores a number of data attributes. I'd like to structure the storage of these attributes, either in subclasses or in dictionaries. My first attempt was this: class A: templates['attr1'] = 'string' queries['children'] = ... class B(A): templates['attr2']