Re: functools and objective usage

2013-10-23 Thread Mohsen Pahlevanzadeh
Another Note: class of caller and myfunc to being differed. On Wed, 2013-10-23 at 21:56 +0330, Mohsen Pahlevanzadeh wrote: > Oh , i changed my code to: > > partial(self.myinstance.myfunc,[arg1,arg2,arg3,arg4,arg5],self.myinstance) > > But i got the following traceback: > TypeError: myfunc() takes

Re: functools and objective usage

2013-10-23 Thread Mohsen Pahlevanzadeh
Oh , i changed my code to: partial(self.myinstance.myfunc,[arg1,arg2,arg3,arg4,arg5],self.myinstance) But i got the following traceback: TypeError: myfunc() takes at least 5 arguments (4 given) ##3 myfunc() prototype is: # def myfunc(self,widget

Re: functools and objective usage

2013-10-23 Thread MRAB
On 23/10/2013 17:48, Mohsen Pahlevanzadeh wrote: Dear all, I have the following code in each steps of loop: obj = partial(self.myinstance.myfunc) obj.func = self.myinstance.myfunc obj.arg = ["TWCH",self,k

Re: functools and objective usage

2013-10-23 Thread Mohsen Pahlevanzadeh
Dear all, I have the following code in each steps of loop: obj = partial(self.myinstance.myfunc) obj.func = self.myinstance.myfunc obj.arg = ["TWCH",self,key,val.checkState(),val] obj.keywords = se

Re: functools and objective usage

2013-10-22 Thread Piet van Oostrum
Mohsen Pahlevanzadeh writes: > Dear all, > > Suppose i have function name, 3 arguments for it, and object of its > caller such as self.blahbalah > So: > my function is: > self.blahblah.name(arg1,arg2,arg3) > > I read functools documentations, may be objictive usage and > functionality differ, Do

Re: functools and objective usage

2013-10-22 Thread MRAB
On 22/10/2013 23:13, Ben Finney wrote: Mohsen Pahlevanzadeh writes: Suppose i have function name, 3 arguments for it, and object of its caller such as self.blahbalah This doesn't make much sense to me. I think you mean: You have an object, ‘self.blahblah’, which has a function attribute, ‘na

Re: functools and objective usage

2013-10-22 Thread Ben Finney
Mohsen Pahlevanzadeh writes: > Suppose i have function name, 3 arguments for it, and object of its > caller such as self.blahbalah This doesn't make much sense to me. I think you mean: You have an object, ‘self.blahblah’, which has a function attribute, ‘name’. (Aside: Please choose better exam

functools and objective usage

2013-10-22 Thread Mohsen Pahlevanzadeh
Dear all, Suppose i have function name, 3 arguments for it, and object of its caller such as self.blahbalah So: my function is: self.blahblah.name(arg1,arg2,arg3) I read functools documentations, may be objictive usage and functionality differ, Do you have experience with objective usage ? http: