Re: Random/anonymous class methods

2008-05-05 Thread philly_bob
On Apr 27, 8:05 am, philly_bob <[EMAIL PROTECTED]> wrote: > In the sample program below, I want to send a random method to a class > instance. > In other words, I don't know which method to send until run-time. How > can I send ch, which is my random choice, to the myclass instance? > > Thanks, >

Re: Random/anonymous class methods

2008-04-27 Thread castironpi
On Apr 27, 7:11 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > philly_bob <[EMAIL PROTECTED]> writes: > > In the sample program below, I want to send a random method to a class > > instance. > > In other words, I don't know which method to send until run-time.  How > > can I send ch, which is my

Re: Random/anonymous class methods

2008-04-27 Thread Ben Finney
philly_bob <[EMAIL PROTECTED]> writes: > How can I send ch, which is my random choice, to the myclass > instance? > > Thanks, > > Bob= > > > import random > > class myclass(object): >def meth1(self): > print 'meth1' >def meth2(self): > print 'meth2' > > c=myclass() >

Re: Random/anonymous class methods

2008-04-27 Thread Arnaud Delobelle
philly_bob <[EMAIL PROTECTED]> writes: > In the sample program below, I want to send a random method to a class > instance. > In other words, I don't know which method to send until run-time. How > can I send ch, which is my random choice, to the myclass instance? > > Thanks, > > Bob= > > >

Random/anonymous class methods

2008-04-27 Thread philly_bob
In the sample program below, I want to send a random method to a class instance. In other words, I don't know which method to send until run-time. How can I send ch, which is my random choice, to the myclass instance? Thanks, Bob= import random class myclass(object): def meth1(self):