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
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.
>
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):
>>
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
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
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
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
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
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,
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
10 matches
Mail list logo