Re: How to pickle bound methods

2008-07-03 Thread Peter Otten
srinivasan srinivas wrote: Please don't top-post. > No. It does not work. That's what I said. Try class A(object): @staticmethod def alpha(): print "Hello" alpha = A.alpha Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pickle bound methods

2008-07-03 Thread srinivasan srinivas
From: Peter Otten <[EMAIL PROTECTED]> To: python-list@python.org Sent: Thursday, 3 July, 2008 12:13:45 PM Subject: Re: How to pickle bound methods srinivasan srinivas wrote: Please don't top-post. > Could you please explain the code breifly?? I am not getting what it does. >

Re: How to pickle bound methods

2008-07-02 Thread Peter Otten
srinivasan srinivas wrote: Please don't top-post. > Could you please explain the code breifly?? I am not getting what it does. >> import copy_reg >> import new >> >> def make_instancemethod(inst, methodname): >>     return getattr(inst, methodname) >> >> def pickle_instancemethod(method): >>  

Re: How to pickle bound methods

2008-07-02 Thread srinivasan srinivas
Peter, Could you please explain the code breifly?? I am not getting what it does. Thanks, Srini  - Original Message From: Peter Otten <[EMAIL PROTECTED]> To: python-list@python.org Sent: Wednesday, 2 July, 2008 12:53:19 PM Subject: Re: How to pickle bound methods srinivasan sr

Re: How to pickle bound methods

2008-07-02 Thread George Sakkis
On Jul 2, 8:26 am, srinivasan srinivas <[EMAIL PROTECTED]> wrote: > I am writing client-server program. The server will send a methodname and its > arguments to a client. The client has to execute the method and return back > the results. Are you aware of Pyro [1] ? Btw, you use the terminology

Re: How to pickle bound methods

2008-07-02 Thread srinivasan srinivas
day, 2 July, 2008 5:15:41 PM Subject: Re: How to pickle bound methods srinivasan srinivas wrote: (Please don't top-post) > It works will for instance and class methods. But it doesn't work for > static methods. Can you tel me how to pickle static methods as well?? For static meth

Re: How to pickle bound methods

2008-07-02 Thread Peter Otten
srinivasan srinivas wrote: (Please don't top-post) > It works will for instance and class methods. But it doesn't work for > static methods. Can you tel me how to pickle static methods as well?? For static methods pickling is not so easy because these don't carry information about the class they

Re: How to pickle bound methods

2008-07-02 Thread srinivasan srinivas
08 12:53:19 PM Subject: Re: How to pickle bound methods srinivasan srinivas wrote: > I would like to know how to pickle a bound method?? $ cat pickle_method.py import copy_reg import new def make_instancemethod(inst, methodname):     return getattr(inst, methodname) def pickle_instanc

Re: How to pickle bound methods

2008-07-02 Thread Peter Otten
srinivasan srinivas wrote: > I would like to know how to pickle a bound method?? $ cat pickle_method.py import copy_reg import new def make_instancemethod(inst, methodname): return getattr(inst, methodname) def pickle_instancemethod(method): return make_instancemethod, (method.im_self,

How to pickle bound methods

2008-07-01 Thread srinivasan srinivas
Hi, I would like to know how to pickle a bound method?? Thanks, Srini Meet people who discuss and share your passions. Go to http://in.promos.yahoo.com/groups/bestofyahoo/ -- http://mail.python.org/mailman/listinfo/python-list