Re: [Tutor] class attribute to initiate more classes

2009-10-31 Thread Vincent Davis
> > > Vincent Davis wrote: > >> DaveA posted >> import random, functools >> >> class Person: >>def __init__(self, size): >>self.size = size >> >>def __str__(self): >>return "Person of size %s" % self.size >> >> class MakePeople: >>def __init__(self, random_func):

Re: [Tutor] class attribute to initiate more classes

2009-10-31 Thread Dave Angel
(You top-posted, which confuses the sequence of message text. So I clipped it off and posted my message at the bottom, which is the convention on this newsgroup) Vincent Davis wrote: DaveA posted import random, functools class Person: def __init__(self, size): self.size = size

Re: [Tutor] class attribute to initiate more classes

2009-10-31 Thread Vincent Davis
DaveA posted import random, functools class Person: def __init__(self, size): self.size = size def __str__(self): return "Person of size %s" % self.size class MakePeople: def __init__(self, random_func): self.random_func = random_func def make_the

Re: [Tutor] class attribute to initiate more classes

2009-10-31 Thread Kent Johnson
On Sat, Oct 31, 2009 at 1:01 AM, Vincent Davis wrote: > I have a program that generates many instances of a class with an attribute > self.x = random.gauss(10, 2). So each instance has a different value for > self.x. This is what I want. Now I want to make a class that starts my > program and sets

Re: [Tutor] class attribute to initiate more classes

2009-10-31 Thread Dave Angel
Vincent Davis wrote: I have a program that generates many instances of a class with an attribute self.x = random.gauss(10, 2). So each instance has a different value for self.x. This is what I want. Now I want to make a class that starts my program and sets the attributes. class people: def _

Re: [Tutor] class attribute to initiate more classes

2009-10-30 Thread Michiel Overtoom
On 31 Oct 2009, at 06:01 , Vincent Davis wrote: I hope this makes sense, I am sure there is a term for what I am trying to do but I don't know it. What a strange program. But at least it compiles: import random class people: def __init__(self, size): self.size = size class mak

[Tutor] class attribute to initiate more classes

2009-10-30 Thread Vincent Davis
I have a program that generates many instances of a class with an attribute self.x = random.gauss(10, 2). So each instance has a different value for self.x. This is what I want. Now I want to make a class that starts my program and sets the attributes. class people: def __init__(self, size)