Re: Creating new instances of subclasses.

2009-01-12 Thread J. Clifford Dyer
On Fri, 2009-01-09 at 10:46 -0800, Dennis Lee Bieber wrote: > On Wed, 07 Jan 2009 11:38:29 -0500, "J. Cliff Dyer" > declaimed the following in comp.lang.python: > > > I want to be able to create an object of a certain subclass, depending > > on the argument given to the class constructor. > > >

Re: Creating new instances of subclasses.

2009-01-09 Thread J. Cliff Dyer
Thanks for the solutions everyone! I'm not sure which I'll end up using, but I think I've got a better grasp of the problem now. Cool stuff. Cheers, Cliff On Thu, 2009-01-08 at 06:52 -0800, Paul McGuire wrote: > On Jan 7, 12:00 pm, Paul McGuire wrote: > > On Jan 7, 10:38 am, "J. Cliff Dyer"

Re: Creating new instances of subclasses.

2009-01-08 Thread Paul McGuire
On Jan 7, 12:00 pm, Paul McGuire wrote: > On Jan 7, 10:38 am, "J. Cliff Dyer" wrote: > > > I want to be able to create an object of a certain subclass, depending > > on the argument given to the class constructor. > > > I have three fields, and one might need to be a StringField, one an > > Integ

Re: Creating new instances of subclasses.

2009-01-08 Thread Nick Craig-Wood
J. Cliff Dyer wrote: > I want to be able to create an object of a certain subclass, depending > on the argument given to the class constructor. > > I have three fields, and one might need to be a StringField, one an > IntegerField, and the last a ListField. But I'd like my class to > delega

Re: Creating new instances of subclasses.

2009-01-07 Thread Bruno Desthuilliers
J. Cliff Dyer a écrit : I want to be able to create an object of a certain subclass, depending on the argument given to the class constructor. I have three fields, and one might need to be a StringField, one an IntegerField, and the last a ListField. But I'd like my class to delegate to the pro

Re: Creating new instances of subclasses.

2009-01-07 Thread Terry Reedy
J. Cliff Dyer wrote: I want to be able to create an object of a certain subclass, depending on the argument given to the class constructor. I have three fields, and one might need to be a StringField, one an IntegerField, and the last a ListField. But I'd like my class to delegate to the proper

Re: Creating new instances of subclasses.

2009-01-07 Thread Paul McGuire
On Jan 7, 10:38 am, "J. Cliff Dyer" wrote: > I want to be able to create an object of a certain subclass, depending > on the argument given to the class constructor. > > I have three fields, and one might need to be a StringField, one an > IntegerField, and the last a ListField.  But I'd like my c