TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'

Jay Parlar jparlar at cogeco.ca
Fri Mar 17 03:58:13 CET 2006

On Mar 16, 2006, at 3:14 PM, Peter Bismuti wrote:
> Can anyone explain this error message? 
>  Traceback (most recent call last):
>    File "/acct/pjb9508/RAT/Scripts/PyQt/RatDialog.py", line 30, in  
> NewClipButton_clicked
> self.rat.planeClip(self.o,"SQUARE"+str(self.squareCounter),width,origin 
> )
>    File "/acct/pjb9508/RAT/Scripts/PyQt/rat.py", line 12, in planeClip
>      plane1[1] = origin[1]-width
>  TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'

It looks like origin[1] and 'width' are both tuples. Substraction is  
not defined on tuples. That's what the error message is saying at  

"TypeError: unsupported operand type(s) for -:" -This means that the  
'-' operator received some bad types, types it doesn't know how to work  

"'tuple' and 'tuple'" - This means the two types it received were both  

Jay P.

More information about the Python-list mailing list