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,key,val.checkState(),val]
             obj.keywords = self.myinstance
########################################################
But i get the following traceback:
############################################
Traceback (most recent call last):
   File "./main.py", line 117, in <module>
     main()
   File "./main.py", line 104, in main
     x.showFindProjects()
   File "/home/mohsen/codes/amlak/amlak/src/UIInterface.py", line 101, in
showFindProjects
     self.uiProjectsFind.setupUi(self.projectsFind)
   File "/home/mohsen/codes/amlak/amlak/src/projectsFind.py", line 288,
in setupUi
     obj.func = self.myinstance.myfunc
TypeError: readonly attribute
###############################################################
Before any help, Thank you...

What are you trying to do?

Why are you trying to change obj.func?

That attribute was set when you created the partial function, and the
other arguments should be provided at the same time.

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to