[Tutor] Unsupported operand types for +: 'NoneType' and 'int' - HUH?!

Alan Gauld alan.gauld@blueyonder.co.uk
Wed Jun 4 02:57:02 2003


> TypeError: unsupported operand types for +: 'NoneType' and 'int'
>
> The culprit is the following function:
>
> def size(self, tree):
> if tree == None: return  <--- You return None here, use 0 instead...

Alan G