Re: dynamic function add to an instance of a class

2010-04-29 Thread News123
Peter Otten wrote: > News123 wrote: >>> >> The drawback would be, that >> b = A(123) >> b.f() >> would still be called with a as bound object. > > There is no b.f until you explicitly assign it with > > b.f = f you are sooo right. My fault. -- http://mail.python.org/mailman/listinfo/python-lis

Re: dynamic function add to an instance of a class

2010-04-29 Thread Peter Otten
News123 wrote: > Peter Otten wrote: >> Richard Lamboj wrote: >> >>> i want to add functions to an instance of a class at runtime. The added >>> function should contain a default parameter value. The function name and >>> function default paramter values should be set dynamical. >> > class A(

Re: dynamic function add to an instance of a class

2010-04-29 Thread Richard Lamboj
Am Thursday 29 April 2010 10:13:01 schrieb Peter Otten: > Richard Lamboj wrote: > > i want to add functions to an instance of a class at runtime. The added > > function should contain a default parameter value. The function name and > > function default paramter values should be set dynamical. > >

Re: dynamic function add to an instance of a class

2010-04-29 Thread News123
Peter Otten wrote: > Richard Lamboj wrote: > >> i want to add functions to an instance of a class at runtime. The added >> function should contain a default parameter value. The function name and >> function default paramter values should be set dynamical. > class A(object): > ... def __

Re: dynamic function add to an instance of a class

2010-04-29 Thread Richard Lamboj
Am Thursday 29 April 2010 09:59:22 schrieb Xavier Ho: > On Thu, Apr 29, 2010 at 5:55 PM, Richard Lamboj wrote: > > Hello, > > > > i want to add functions to an instance of a class at runtime. The added > > function should contain a default parameter value. The function name and > > function defau

Re: dynamic function add to an instance of a class

2010-04-29 Thread Peter Otten
Richard Lamboj wrote: > i want to add functions to an instance of a class at runtime. The added > function should contain a default parameter value. The function name and > function default paramter values should be set dynamical. >>> class A(object): ... def __init__(self, x): ...

Re: dynamic function add to an instance of a class

2010-04-29 Thread James Mills
On Thu, Apr 29, 2010 at 5:55 PM, Richard Lamboj wrote: > i want to add functions to an instance of a class at runtime. The added > function should contain a default parameter value. The function name and > function default paramter values should be set dynamical. The normal way of doing this by b

Re: dynamic function add to an instance of a class

2010-04-29 Thread Xavier Ho
On Thu, Apr 29, 2010 at 5:55 PM, Richard Lamboj wrote: > > Hello, > > i want to add functions to an instance of a class at runtime. The added > function should contain a default parameter value. The function name and > function default paramter values should be set dynamical. > > Kind Regards, > >

dynamic function add to an instance of a class

2010-04-29 Thread Richard Lamboj
Hello, i want to add functions to an instance of a class at runtime. The added function should contain a default parameter value. The function name and function default paramter values should be set dynamical. Kind Regards, Richi -- http://mail.python.org/mailman/listinfo/python-list