On 3/31/12 2:13 AM, Antonio Valentino wrote: > Hi Danid, hi Francesc, > > Il 31/03/2012 03:08, Francesc Alted ha scritto: >> On 3/30/12 7:57 PM, Daπid wrote: >>> Hello, >>> >>> I have several different kinds of data tables, absolutely independent, >>> defined as in the tutorial >>> (http://pytables.github.com/usersguide/tutorials.html): >>> > [CUT] > >>> One, naively, saw the repetition and would want to do something like: >>> >>> class Pie(IsDescription): # All kind of pies >>> dough=Int64Col() >>> baking=Float64Col() >>> >>> >>> class SaltedPie(Pie): >>> anchovy=Float32Col() >>> >>> class SweetPie(Pie): >>> apple=UInt32Col() >>> >>> >>> but, when I try to set 'dough', I get: >>> >>> KeyError: 'no such column: dough' >>> >>> >>> Of course, my approach is not correct. Is there a valid way of doing it? >> Right, subclassing IsDescription is not supported. Sorry, but I think >> that the only way is to do the repetition explicitly. Or, maybe you can >> use a NumPy dtype instead, that allows you to create table schemas more >> succinctly. >> > Some work on in broken inheritance of IsDescriptor has been done in the > development branch (see [#65]). Thanks to Andrea Bedini for the patch. > > Which version of PyTables are you using David? > > > cheers > > [#65] https://github.com/PyTables/PyTables/issues/65
Oh, that's a nice addition indeed. Thanks for the remind! -- Francesc Alted ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Pytables-users mailing list Pytables-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pytables-users